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 affiliate: Option<solana_address::Address>,
82 pub sats_vault: solana_address::Address,
87 pub btc_mint: solana_address::Address,
92 pub usd_mint: solana_address::Address,
99 pub board_usd_ata: solana_address::Address,
107 pub board_btc_ata: solana_address::Address,
114 pub sats_vault_btc_ata: solana_address::Address,
119 pub token_vault: solana_address::Address,
124
125
126 pub token_program: solana_address::Address,
127
128
129 pub associated_token_program: solana_address::Address,
130
131
132 pub system_program: solana_address::Address,
133
134
135 pub event_authority: solana_address::Address,
136
137
138 pub program: solana_address::Address,
139 }
140
141impl SettleDeployPublic {
142 pub fn instruction(&self) -> solana_instruction::Instruction {
143 self.instruction_with_remaining_accounts(&[])
144 }
145 #[allow(clippy::arithmetic_side_effects)]
146 #[allow(clippy::vec_init_then_push)]
147 pub fn instruction_with_remaining_accounts(&self, remaining_accounts: &[solana_instruction::AccountMeta]) -> solana_instruction::Instruction {
148 let mut accounts = Vec::with_capacity(23+ remaining_accounts.len());
149 accounts.push(solana_instruction::AccountMeta::new(
150 self.authority,
151 true
152 ));
153 accounts.push(solana_instruction::AccountMeta::new_readonly(
154 self.satrush_config,
155 false
156 ));
157 accounts.push(solana_instruction::AccountMeta::new(
158 self.round,
159 false
160 ));
161 accounts.push(solana_instruction::AccountMeta::new_readonly(
162 self.board,
163 false
164 ));
165 accounts.push(solana_instruction::AccountMeta::new(
166 self.rent_recipient,
167 false
168 ));
169 accounts.push(solana_instruction::AccountMeta::new(
170 self.public_deployment,
171 false
172 ));
173 accounts.push(solana_instruction::AccountMeta::new(
174 self.miner,
175 false
176 ));
177 accounts.push(solana_instruction::AccountMeta::new(
178 self.public_automation,
179 false
180 ));
181 accounts.push(solana_instruction::AccountMeta::new(
182 self.automation_usd_ata,
183 false
184 ));
185 accounts.push(solana_instruction::AccountMeta::new(
186 self.miner_usd_ata,
187 false
188 ));
189 if let Some(affiliate) = self.affiliate {
190 accounts.push(solana_instruction::AccountMeta::new(
191 affiliate,
192 false,
193 ));
194 } else {
195 accounts.push(solana_instruction::AccountMeta::new_readonly(
196 crate::SATRUSH_ID,
197 false,
198 ));
199 }
200 accounts.push(solana_instruction::AccountMeta::new(
201 self.sats_vault,
202 false
203 ));
204 accounts.push(solana_instruction::AccountMeta::new_readonly(
205 self.btc_mint,
206 false
207 ));
208 accounts.push(solana_instruction::AccountMeta::new_readonly(
209 self.usd_mint,
210 false
211 ));
212 accounts.push(solana_instruction::AccountMeta::new(
213 self.board_usd_ata,
214 false
215 ));
216 accounts.push(solana_instruction::AccountMeta::new(
217 self.board_btc_ata,
218 false
219 ));
220 accounts.push(solana_instruction::AccountMeta::new(
221 self.sats_vault_btc_ata,
222 false
223 ));
224 accounts.push(solana_instruction::AccountMeta::new(
225 self.token_vault,
226 false
227 ));
228 accounts.push(solana_instruction::AccountMeta::new_readonly(
229 self.token_program,
230 false
231 ));
232 accounts.push(solana_instruction::AccountMeta::new_readonly(
233 self.associated_token_program,
234 false
235 ));
236 accounts.push(solana_instruction::AccountMeta::new_readonly(
237 self.system_program,
238 false
239 ));
240 accounts.push(solana_instruction::AccountMeta::new_readonly(
241 self.event_authority,
242 false
243 ));
244 accounts.push(solana_instruction::AccountMeta::new_readonly(
245 self.program,
246 false
247 ));
248 accounts.extend_from_slice(remaining_accounts);
249 let data = SettleDeployPublicInstructionData::new().try_to_vec().unwrap();
250
251 solana_instruction::Instruction {
252 program_id: crate::SATRUSH_ID,
253 accounts,
254 data,
255 }
256 }
257}
258
259#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
260 pub struct SettleDeployPublicInstructionData {
261 discriminator: [u8; 8],
262 }
263
264impl SettleDeployPublicInstructionData {
265 pub fn new() -> Self {
266 Self {
267 discriminator: [249, 111, 122, 103, 93, 86, 76, 198],
268 }
269 }
270
271 pub(crate) fn try_to_vec(&self) -> Result<Vec<u8>, std::io::Error> {
272 borsh::to_vec(self)
273 }
274 }
275
276impl Default for SettleDeployPublicInstructionData {
277 fn default() -> Self {
278 Self::new()
279 }
280}
281
282
283
284#[derive(Clone, Debug, Default)]
312pub struct SettleDeployPublicBuilder {
313 authority: Option<solana_address::Address>,
314 satrush_config: Option<solana_address::Address>,
315 round: Option<solana_address::Address>,
316 board: Option<solana_address::Address>,
317 rent_recipient: Option<solana_address::Address>,
318 public_deployment: Option<solana_address::Address>,
319 miner: Option<solana_address::Address>,
320 public_automation: Option<solana_address::Address>,
321 automation_usd_ata: Option<solana_address::Address>,
322 miner_usd_ata: Option<solana_address::Address>,
323 affiliate: Option<solana_address::Address>,
324 sats_vault: Option<solana_address::Address>,
325 btc_mint: Option<solana_address::Address>,
326 usd_mint: Option<solana_address::Address>,
327 board_usd_ata: Option<solana_address::Address>,
328 board_btc_ata: Option<solana_address::Address>,
329 sats_vault_btc_ata: Option<solana_address::Address>,
330 token_vault: Option<solana_address::Address>,
331 token_program: Option<solana_address::Address>,
332 associated_token_program: Option<solana_address::Address>,
333 system_program: Option<solana_address::Address>,
334 event_authority: Option<solana_address::Address>,
335 program: Option<solana_address::Address>,
336 __remaining_accounts: Vec<solana_instruction::AccountMeta>,
337}
338
339impl SettleDeployPublicBuilder {
340 pub fn new() -> Self {
341 Self::default()
342 }
343 #[inline(always)]
346 pub fn authority(&mut self, authority: solana_address::Address) -> &mut Self {
347 self.authority = Some(authority);
348 self
349 }
350 #[inline(always)]
351 pub fn satrush_config(&mut self, satrush_config: solana_address::Address) -> &mut Self {
352 self.satrush_config = Some(satrush_config);
353 self
354 }
355 #[inline(always)]
357 pub fn round(&mut self, round: solana_address::Address) -> &mut Self {
358 self.round = Some(round);
359 self
360 }
361 #[inline(always)]
363 pub fn board(&mut self, board: solana_address::Address) -> &mut Self {
364 self.board = Some(board);
365 self
366 }
367 #[inline(always)]
370 pub fn rent_recipient(&mut self, rent_recipient: solana_address::Address) -> &mut Self {
371 self.rent_recipient = Some(rent_recipient);
372 self
373 }
374 #[inline(always)]
377 pub fn public_deployment(&mut self, public_deployment: solana_address::Address) -> &mut Self {
378 self.public_deployment = Some(public_deployment);
379 self
380 }
381 #[inline(always)]
383 pub fn miner(&mut self, miner: solana_address::Address) -> &mut Self {
384 self.miner = Some(miner);
385 self
386 }
387 #[inline(always)]
391 pub fn public_automation(&mut self, public_automation: solana_address::Address) -> &mut Self {
392 self.public_automation = Some(public_automation);
393 self
394 }
395 #[inline(always)]
398 pub fn automation_usd_ata(&mut self, automation_usd_ata: solana_address::Address) -> &mut Self {
399 self.automation_usd_ata = Some(automation_usd_ata);
400 self
401 }
402 #[inline(always)]
405 pub fn miner_usd_ata(&mut self, miner_usd_ata: solana_address::Address) -> &mut Self {
406 self.miner_usd_ata = Some(miner_usd_ata);
407 self
408 }
409 #[inline(always)]
418 pub fn affiliate(&mut self, affiliate: Option<solana_address::Address>) -> &mut Self {
419 self.affiliate = affiliate;
420 self
421 }
422 #[inline(always)]
424 pub fn sats_vault(&mut self, sats_vault: solana_address::Address) -> &mut Self {
425 self.sats_vault = Some(sats_vault);
426 self
427 }
428 #[inline(always)]
430 pub fn btc_mint(&mut self, btc_mint: solana_address::Address) -> &mut Self {
431 self.btc_mint = Some(btc_mint);
432 self
433 }
434 #[inline(always)]
438 pub fn usd_mint(&mut self, usd_mint: solana_address::Address) -> &mut Self {
439 self.usd_mint = Some(usd_mint);
440 self
441 }
442 #[inline(always)]
447 pub fn board_usd_ata(&mut self, board_usd_ata: solana_address::Address) -> &mut Self {
448 self.board_usd_ata = Some(board_usd_ata);
449 self
450 }
451 #[inline(always)]
455 pub fn board_btc_ata(&mut self, board_btc_ata: solana_address::Address) -> &mut Self {
456 self.board_btc_ata = Some(board_btc_ata);
457 self
458 }
459 #[inline(always)]
461 pub fn sats_vault_btc_ata(&mut self, sats_vault_btc_ata: solana_address::Address) -> &mut Self {
462 self.sats_vault_btc_ata = Some(sats_vault_btc_ata);
463 self
464 }
465 #[inline(always)]
467 pub fn token_vault(&mut self, token_vault: solana_address::Address) -> &mut Self {
468 self.token_vault = Some(token_vault);
469 self
470 }
471 #[inline(always)]
473 pub fn token_program(&mut self, token_program: solana_address::Address) -> &mut Self {
474 self.token_program = Some(token_program);
475 self
476 }
477 #[inline(always)]
479 pub fn associated_token_program(&mut self, associated_token_program: solana_address::Address) -> &mut Self {
480 self.associated_token_program = Some(associated_token_program);
481 self
482 }
483 #[inline(always)]
485 pub fn system_program(&mut self, system_program: solana_address::Address) -> &mut Self {
486 self.system_program = Some(system_program);
487 self
488 }
489 #[inline(always)]
490 pub fn event_authority(&mut self, event_authority: solana_address::Address) -> &mut Self {
491 self.event_authority = Some(event_authority);
492 self
493 }
494 #[inline(always)]
495 pub fn program(&mut self, program: solana_address::Address) -> &mut Self {
496 self.program = Some(program);
497 self
498 }
499 #[inline(always)]
501 pub fn add_remaining_account(&mut self, account: solana_instruction::AccountMeta) -> &mut Self {
502 self.__remaining_accounts.push(account);
503 self
504 }
505 #[inline(always)]
507 pub fn add_remaining_accounts(&mut self, accounts: &[solana_instruction::AccountMeta]) -> &mut Self {
508 self.__remaining_accounts.extend_from_slice(accounts);
509 self
510 }
511 #[allow(clippy::clone_on_copy)]
512 pub fn instruction(&self) -> solana_instruction::Instruction {
513 let accounts = SettleDeployPublic {
514 authority: self.authority.expect("authority is not set"),
515 satrush_config: self.satrush_config.expect("satrush_config is not set"),
516 round: self.round.expect("round is not set"),
517 board: self.board.expect("board is not set"),
518 rent_recipient: self.rent_recipient.expect("rent_recipient is not set"),
519 public_deployment: self.public_deployment.expect("public_deployment is not set"),
520 miner: self.miner.expect("miner is not set"),
521 public_automation: self.public_automation.expect("public_automation is not set"),
522 automation_usd_ata: self.automation_usd_ata.expect("automation_usd_ata is not set"),
523 miner_usd_ata: self.miner_usd_ata.expect("miner_usd_ata is not set"),
524 affiliate: self.affiliate,
525 sats_vault: self.sats_vault.expect("sats_vault is not set"),
526 btc_mint: self.btc_mint.expect("btc_mint is not set"),
527 usd_mint: self.usd_mint.expect("usd_mint is not set"),
528 board_usd_ata: self.board_usd_ata.expect("board_usd_ata is not set"),
529 board_btc_ata: self.board_btc_ata.expect("board_btc_ata is not set"),
530 sats_vault_btc_ata: self.sats_vault_btc_ata.expect("sats_vault_btc_ata is not set"),
531 token_vault: self.token_vault.expect("token_vault is not set"),
532 token_program: self.token_program.unwrap_or(solana_address::address!("TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA")),
533 associated_token_program: self.associated_token_program.unwrap_or(solana_address::address!("ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL")),
534 system_program: self.system_program.unwrap_or(solana_address::address!("11111111111111111111111111111111")),
535 event_authority: self.event_authority.expect("event_authority is not set"),
536 program: self.program.expect("program is not set"),
537 };
538
539 accounts.instruction_with_remaining_accounts(&self.__remaining_accounts)
540 }
541}
542
543 pub struct SettleDeployPublicCpiAccounts<'a, 'b> {
545 pub authority: &'b solana_account_info::AccountInfo<'a>,
551
552
553 pub satrush_config: &'b solana_account_info::AccountInfo<'a>,
554 pub round: &'b solana_account_info::AccountInfo<'a>,
559 pub board: &'b solana_account_info::AccountInfo<'a>,
564 pub rent_recipient: &'b solana_account_info::AccountInfo<'a>,
570 pub public_deployment: &'b solana_account_info::AccountInfo<'a>,
576 pub miner: &'b solana_account_info::AccountInfo<'a>,
581 pub public_automation: &'b solana_account_info::AccountInfo<'a>,
588 pub automation_usd_ata: &'b solana_account_info::AccountInfo<'a>,
594 pub miner_usd_ata: &'b solana_account_info::AccountInfo<'a>,
600 pub affiliate: Option<&'b solana_account_info::AccountInfo<'a>>,
611 pub sats_vault: &'b solana_account_info::AccountInfo<'a>,
616 pub btc_mint: &'b solana_account_info::AccountInfo<'a>,
621 pub usd_mint: &'b solana_account_info::AccountInfo<'a>,
628 pub board_usd_ata: &'b solana_account_info::AccountInfo<'a>,
636 pub board_btc_ata: &'b solana_account_info::AccountInfo<'a>,
643 pub sats_vault_btc_ata: &'b solana_account_info::AccountInfo<'a>,
648 pub token_vault: &'b solana_account_info::AccountInfo<'a>,
653
654
655 pub token_program: &'b solana_account_info::AccountInfo<'a>,
656
657
658 pub associated_token_program: &'b solana_account_info::AccountInfo<'a>,
659
660
661 pub system_program: &'b solana_account_info::AccountInfo<'a>,
662
663
664 pub event_authority: &'b solana_account_info::AccountInfo<'a>,
665
666
667 pub program: &'b solana_account_info::AccountInfo<'a>,
668 }
669
670pub struct SettleDeployPublicCpi<'a, 'b> {
672 pub __program: &'b solana_account_info::AccountInfo<'a>,
674 pub authority: &'b solana_account_info::AccountInfo<'a>,
680
681
682 pub satrush_config: &'b solana_account_info::AccountInfo<'a>,
683 pub round: &'b solana_account_info::AccountInfo<'a>,
688 pub board: &'b solana_account_info::AccountInfo<'a>,
693 pub rent_recipient: &'b solana_account_info::AccountInfo<'a>,
699 pub public_deployment: &'b solana_account_info::AccountInfo<'a>,
705 pub miner: &'b solana_account_info::AccountInfo<'a>,
710 pub public_automation: &'b solana_account_info::AccountInfo<'a>,
717 pub automation_usd_ata: &'b solana_account_info::AccountInfo<'a>,
723 pub miner_usd_ata: &'b solana_account_info::AccountInfo<'a>,
729 pub affiliate: Option<&'b solana_account_info::AccountInfo<'a>>,
740 pub sats_vault: &'b solana_account_info::AccountInfo<'a>,
745 pub btc_mint: &'b solana_account_info::AccountInfo<'a>,
750 pub usd_mint: &'b solana_account_info::AccountInfo<'a>,
757 pub board_usd_ata: &'b solana_account_info::AccountInfo<'a>,
765 pub board_btc_ata: &'b solana_account_info::AccountInfo<'a>,
772 pub sats_vault_btc_ata: &'b solana_account_info::AccountInfo<'a>,
777 pub token_vault: &'b solana_account_info::AccountInfo<'a>,
782
783
784 pub token_program: &'b solana_account_info::AccountInfo<'a>,
785
786
787 pub associated_token_program: &'b solana_account_info::AccountInfo<'a>,
788
789
790 pub system_program: &'b solana_account_info::AccountInfo<'a>,
791
792
793 pub event_authority: &'b solana_account_info::AccountInfo<'a>,
794
795
796 pub program: &'b solana_account_info::AccountInfo<'a>,
797 }
798
799impl<'a, 'b> SettleDeployPublicCpi<'a, 'b> {
800 pub fn new(
801 program: &'b solana_account_info::AccountInfo<'a>,
802 accounts: SettleDeployPublicCpiAccounts<'a, 'b>,
803 ) -> Self {
804 Self {
805 __program: program,
806 authority: accounts.authority,
807 satrush_config: accounts.satrush_config,
808 round: accounts.round,
809 board: accounts.board,
810 rent_recipient: accounts.rent_recipient,
811 public_deployment: accounts.public_deployment,
812 miner: accounts.miner,
813 public_automation: accounts.public_automation,
814 automation_usd_ata: accounts.automation_usd_ata,
815 miner_usd_ata: accounts.miner_usd_ata,
816 affiliate: accounts.affiliate,
817 sats_vault: accounts.sats_vault,
818 btc_mint: accounts.btc_mint,
819 usd_mint: accounts.usd_mint,
820 board_usd_ata: accounts.board_usd_ata,
821 board_btc_ata: accounts.board_btc_ata,
822 sats_vault_btc_ata: accounts.sats_vault_btc_ata,
823 token_vault: accounts.token_vault,
824 token_program: accounts.token_program,
825 associated_token_program: accounts.associated_token_program,
826 system_program: accounts.system_program,
827 event_authority: accounts.event_authority,
828 program: accounts.program,
829 }
830 }
831 #[inline(always)]
832 pub fn invoke(&self) -> solana_program_error::ProgramResult {
833 self.invoke_signed_with_remaining_accounts(&[], &[])
834 }
835 #[inline(always)]
836 pub fn invoke_with_remaining_accounts(&self, remaining_accounts: &[(&'b solana_account_info::AccountInfo<'a>, bool, bool)]) -> solana_program_error::ProgramResult {
837 self.invoke_signed_with_remaining_accounts(&[], remaining_accounts)
838 }
839 #[inline(always)]
840 pub fn invoke_signed(&self, signers_seeds: &[&[&[u8]]]) -> solana_program_error::ProgramResult {
841 self.invoke_signed_with_remaining_accounts(signers_seeds, &[])
842 }
843 #[allow(clippy::arithmetic_side_effects)]
844 #[allow(clippy::clone_on_copy)]
845 #[allow(clippy::vec_init_then_push)]
846 pub fn invoke_signed_with_remaining_accounts(
847 &self,
848 signers_seeds: &[&[&[u8]]],
849 remaining_accounts: &[(&'b solana_account_info::AccountInfo<'a>, bool, bool)]
850 ) -> solana_program_error::ProgramResult {
851 let mut accounts = Vec::with_capacity(23+ remaining_accounts.len());
852 accounts.push(solana_instruction::AccountMeta::new(
853 *self.authority.key,
854 true
855 ));
856 accounts.push(solana_instruction::AccountMeta::new_readonly(
857 *self.satrush_config.key,
858 false
859 ));
860 accounts.push(solana_instruction::AccountMeta::new(
861 *self.round.key,
862 false
863 ));
864 accounts.push(solana_instruction::AccountMeta::new_readonly(
865 *self.board.key,
866 false
867 ));
868 accounts.push(solana_instruction::AccountMeta::new(
869 *self.rent_recipient.key,
870 false
871 ));
872 accounts.push(solana_instruction::AccountMeta::new(
873 *self.public_deployment.key,
874 false
875 ));
876 accounts.push(solana_instruction::AccountMeta::new(
877 *self.miner.key,
878 false
879 ));
880 accounts.push(solana_instruction::AccountMeta::new(
881 *self.public_automation.key,
882 false
883 ));
884 accounts.push(solana_instruction::AccountMeta::new(
885 *self.automation_usd_ata.key,
886 false
887 ));
888 accounts.push(solana_instruction::AccountMeta::new(
889 *self.miner_usd_ata.key,
890 false
891 ));
892 if let Some(affiliate) = self.affiliate {
893 accounts.push(solana_instruction::AccountMeta::new(
894 *affiliate.key,
895 false,
896 ));
897 } else {
898 accounts.push(solana_instruction::AccountMeta::new_readonly(
899 crate::SATRUSH_ID,
900 false,
901 ));
902 }
903 accounts.push(solana_instruction::AccountMeta::new(
904 *self.sats_vault.key,
905 false
906 ));
907 accounts.push(solana_instruction::AccountMeta::new_readonly(
908 *self.btc_mint.key,
909 false
910 ));
911 accounts.push(solana_instruction::AccountMeta::new_readonly(
912 *self.usd_mint.key,
913 false
914 ));
915 accounts.push(solana_instruction::AccountMeta::new(
916 *self.board_usd_ata.key,
917 false
918 ));
919 accounts.push(solana_instruction::AccountMeta::new(
920 *self.board_btc_ata.key,
921 false
922 ));
923 accounts.push(solana_instruction::AccountMeta::new(
924 *self.sats_vault_btc_ata.key,
925 false
926 ));
927 accounts.push(solana_instruction::AccountMeta::new(
928 *self.token_vault.key,
929 false
930 ));
931 accounts.push(solana_instruction::AccountMeta::new_readonly(
932 *self.token_program.key,
933 false
934 ));
935 accounts.push(solana_instruction::AccountMeta::new_readonly(
936 *self.associated_token_program.key,
937 false
938 ));
939 accounts.push(solana_instruction::AccountMeta::new_readonly(
940 *self.system_program.key,
941 false
942 ));
943 accounts.push(solana_instruction::AccountMeta::new_readonly(
944 *self.event_authority.key,
945 false
946 ));
947 accounts.push(solana_instruction::AccountMeta::new_readonly(
948 *self.program.key,
949 false
950 ));
951 remaining_accounts.iter().for_each(|remaining_account| {
952 accounts.push(solana_instruction::AccountMeta {
953 pubkey: *remaining_account.0.key,
954 is_signer: remaining_account.1,
955 is_writable: remaining_account.2,
956 })
957 });
958 let data = SettleDeployPublicInstructionData::new().try_to_vec().unwrap();
959
960 let instruction = solana_instruction::Instruction {
961 program_id: crate::SATRUSH_ID,
962 accounts,
963 data,
964 };
965 let mut account_infos = Vec::with_capacity(24 + remaining_accounts.len());
966 account_infos.push(self.__program.clone());
967 account_infos.push(self.authority.clone());
968 account_infos.push(self.satrush_config.clone());
969 account_infos.push(self.round.clone());
970 account_infos.push(self.board.clone());
971 account_infos.push(self.rent_recipient.clone());
972 account_infos.push(self.public_deployment.clone());
973 account_infos.push(self.miner.clone());
974 account_infos.push(self.public_automation.clone());
975 account_infos.push(self.automation_usd_ata.clone());
976 account_infos.push(self.miner_usd_ata.clone());
977 if let Some(affiliate) = self.affiliate {
978 account_infos.push(affiliate.clone());
979 }
980 account_infos.push(self.sats_vault.clone());
981 account_infos.push(self.btc_mint.clone());
982 account_infos.push(self.usd_mint.clone());
983 account_infos.push(self.board_usd_ata.clone());
984 account_infos.push(self.board_btc_ata.clone());
985 account_infos.push(self.sats_vault_btc_ata.clone());
986 account_infos.push(self.token_vault.clone());
987 account_infos.push(self.token_program.clone());
988 account_infos.push(self.associated_token_program.clone());
989 account_infos.push(self.system_program.clone());
990 account_infos.push(self.event_authority.clone());
991 account_infos.push(self.program.clone());
992 remaining_accounts.iter().for_each(|remaining_account| account_infos.push(remaining_account.0.clone()));
993
994 if signers_seeds.is_empty() {
995 solana_cpi::invoke(&instruction, &account_infos)
996 } else {
997 solana_cpi::invoke_signed(&instruction, &account_infos, signers_seeds)
998 }
999 }
1000}
1001
1002#[derive(Clone, Debug)]
1030pub struct SettleDeployPublicCpiBuilder<'a, 'b> {
1031 instruction: Box<SettleDeployPublicCpiBuilderInstruction<'a, 'b>>,
1032}
1033
1034impl<'a, 'b> SettleDeployPublicCpiBuilder<'a, 'b> {
1035 pub fn new(program: &'b solana_account_info::AccountInfo<'a>) -> Self {
1036 let instruction = Box::new(SettleDeployPublicCpiBuilderInstruction {
1037 __program: program,
1038 authority: None,
1039 satrush_config: None,
1040 round: None,
1041 board: None,
1042 rent_recipient: None,
1043 public_deployment: None,
1044 miner: None,
1045 public_automation: None,
1046 automation_usd_ata: None,
1047 miner_usd_ata: None,
1048 affiliate: None,
1049 sats_vault: None,
1050 btc_mint: None,
1051 usd_mint: None,
1052 board_usd_ata: None,
1053 board_btc_ata: None,
1054 sats_vault_btc_ata: None,
1055 token_vault: None,
1056 token_program: None,
1057 associated_token_program: None,
1058 system_program: None,
1059 event_authority: None,
1060 program: None,
1061 __remaining_accounts: Vec::new(),
1062 });
1063 Self { instruction }
1064 }
1065 #[inline(always)]
1068 pub fn authority(&mut self, authority: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
1069 self.instruction.authority = Some(authority);
1070 self
1071 }
1072 #[inline(always)]
1073 pub fn satrush_config(&mut self, satrush_config: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
1074 self.instruction.satrush_config = Some(satrush_config);
1075 self
1076 }
1077 #[inline(always)]
1079 pub fn round(&mut self, round: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
1080 self.instruction.round = Some(round);
1081 self
1082 }
1083 #[inline(always)]
1085 pub fn board(&mut self, board: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
1086 self.instruction.board = Some(board);
1087 self
1088 }
1089 #[inline(always)]
1092 pub fn rent_recipient(&mut self, rent_recipient: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
1093 self.instruction.rent_recipient = Some(rent_recipient);
1094 self
1095 }
1096 #[inline(always)]
1099 pub fn public_deployment(&mut self, public_deployment: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
1100 self.instruction.public_deployment = Some(public_deployment);
1101 self
1102 }
1103 #[inline(always)]
1105 pub fn miner(&mut self, miner: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
1106 self.instruction.miner = Some(miner);
1107 self
1108 }
1109 #[inline(always)]
1113 pub fn public_automation(&mut self, public_automation: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
1114 self.instruction.public_automation = Some(public_automation);
1115 self
1116 }
1117 #[inline(always)]
1120 pub fn automation_usd_ata(&mut self, automation_usd_ata: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
1121 self.instruction.automation_usd_ata = Some(automation_usd_ata);
1122 self
1123 }
1124 #[inline(always)]
1127 pub fn miner_usd_ata(&mut self, miner_usd_ata: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
1128 self.instruction.miner_usd_ata = Some(miner_usd_ata);
1129 self
1130 }
1131 #[inline(always)]
1140 pub fn affiliate(&mut self, affiliate: Option<&'b solana_account_info::AccountInfo<'a>>) -> &mut Self {
1141 self.instruction.affiliate = affiliate;
1142 self
1143 }
1144 #[inline(always)]
1146 pub fn sats_vault(&mut self, sats_vault: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
1147 self.instruction.sats_vault = Some(sats_vault);
1148 self
1149 }
1150 #[inline(always)]
1152 pub fn btc_mint(&mut self, btc_mint: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
1153 self.instruction.btc_mint = Some(btc_mint);
1154 self
1155 }
1156 #[inline(always)]
1160 pub fn usd_mint(&mut self, usd_mint: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
1161 self.instruction.usd_mint = Some(usd_mint);
1162 self
1163 }
1164 #[inline(always)]
1169 pub fn board_usd_ata(&mut self, board_usd_ata: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
1170 self.instruction.board_usd_ata = Some(board_usd_ata);
1171 self
1172 }
1173 #[inline(always)]
1177 pub fn board_btc_ata(&mut self, board_btc_ata: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
1178 self.instruction.board_btc_ata = Some(board_btc_ata);
1179 self
1180 }
1181 #[inline(always)]
1183 pub fn sats_vault_btc_ata(&mut self, sats_vault_btc_ata: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
1184 self.instruction.sats_vault_btc_ata = Some(sats_vault_btc_ata);
1185 self
1186 }
1187 #[inline(always)]
1189 pub fn token_vault(&mut self, token_vault: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
1190 self.instruction.token_vault = Some(token_vault);
1191 self
1192 }
1193 #[inline(always)]
1194 pub fn token_program(&mut self, token_program: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
1195 self.instruction.token_program = Some(token_program);
1196 self
1197 }
1198 #[inline(always)]
1199 pub fn associated_token_program(&mut self, associated_token_program: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
1200 self.instruction.associated_token_program = Some(associated_token_program);
1201 self
1202 }
1203 #[inline(always)]
1204 pub fn system_program(&mut self, system_program: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
1205 self.instruction.system_program = Some(system_program);
1206 self
1207 }
1208 #[inline(always)]
1209 pub fn event_authority(&mut self, event_authority: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
1210 self.instruction.event_authority = Some(event_authority);
1211 self
1212 }
1213 #[inline(always)]
1214 pub fn program(&mut self, program: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
1215 self.instruction.program = Some(program);
1216 self
1217 }
1218 #[inline(always)]
1220 pub fn add_remaining_account(&mut self, account: &'b solana_account_info::AccountInfo<'a>, is_writable: bool, is_signer: bool) -> &mut Self {
1221 self.instruction.__remaining_accounts.push((account, is_writable, is_signer));
1222 self
1223 }
1224 #[inline(always)]
1229 pub fn add_remaining_accounts(&mut self, accounts: &[(&'b solana_account_info::AccountInfo<'a>, bool, bool)]) -> &mut Self {
1230 self.instruction.__remaining_accounts.extend_from_slice(accounts);
1231 self
1232 }
1233 #[inline(always)]
1234 pub fn invoke(&self) -> solana_program_error::ProgramResult {
1235 self.invoke_signed(&[])
1236 }
1237 #[allow(clippy::clone_on_copy)]
1238 #[allow(clippy::vec_init_then_push)]
1239 pub fn invoke_signed(&self, signers_seeds: &[&[&[u8]]]) -> solana_program_error::ProgramResult {
1240 let instruction = SettleDeployPublicCpi {
1241 __program: self.instruction.__program,
1242
1243 authority: self.instruction.authority.expect("authority is not set"),
1244
1245 satrush_config: self.instruction.satrush_config.expect("satrush_config is not set"),
1246
1247 round: self.instruction.round.expect("round is not set"),
1248
1249 board: self.instruction.board.expect("board is not set"),
1250
1251 rent_recipient: self.instruction.rent_recipient.expect("rent_recipient is not set"),
1252
1253 public_deployment: self.instruction.public_deployment.expect("public_deployment is not set"),
1254
1255 miner: self.instruction.miner.expect("miner is not set"),
1256
1257 public_automation: self.instruction.public_automation.expect("public_automation is not set"),
1258
1259 automation_usd_ata: self.instruction.automation_usd_ata.expect("automation_usd_ata is not set"),
1260
1261 miner_usd_ata: self.instruction.miner_usd_ata.expect("miner_usd_ata is not set"),
1262
1263 affiliate: self.instruction.affiliate,
1264
1265 sats_vault: self.instruction.sats_vault.expect("sats_vault is not set"),
1266
1267 btc_mint: self.instruction.btc_mint.expect("btc_mint is not set"),
1268
1269 usd_mint: self.instruction.usd_mint.expect("usd_mint is not set"),
1270
1271 board_usd_ata: self.instruction.board_usd_ata.expect("board_usd_ata is not set"),
1272
1273 board_btc_ata: self.instruction.board_btc_ata.expect("board_btc_ata is not set"),
1274
1275 sats_vault_btc_ata: self.instruction.sats_vault_btc_ata.expect("sats_vault_btc_ata is not set"),
1276
1277 token_vault: self.instruction.token_vault.expect("token_vault is not set"),
1278
1279 token_program: self.instruction.token_program.expect("token_program is not set"),
1280
1281 associated_token_program: self.instruction.associated_token_program.expect("associated_token_program is not set"),
1282
1283 system_program: self.instruction.system_program.expect("system_program is not set"),
1284
1285 event_authority: self.instruction.event_authority.expect("event_authority is not set"),
1286
1287 program: self.instruction.program.expect("program is not set"),
1288 };
1289 instruction.invoke_signed_with_remaining_accounts(signers_seeds, &self.instruction.__remaining_accounts)
1290 }
1291}
1292
1293#[derive(Clone, Debug)]
1294struct SettleDeployPublicCpiBuilderInstruction<'a, 'b> {
1295 __program: &'b solana_account_info::AccountInfo<'a>,
1296 authority: Option<&'b solana_account_info::AccountInfo<'a>>,
1297 satrush_config: Option<&'b solana_account_info::AccountInfo<'a>>,
1298 round: Option<&'b solana_account_info::AccountInfo<'a>>,
1299 board: Option<&'b solana_account_info::AccountInfo<'a>>,
1300 rent_recipient: Option<&'b solana_account_info::AccountInfo<'a>>,
1301 public_deployment: Option<&'b solana_account_info::AccountInfo<'a>>,
1302 miner: Option<&'b solana_account_info::AccountInfo<'a>>,
1303 public_automation: Option<&'b solana_account_info::AccountInfo<'a>>,
1304 automation_usd_ata: Option<&'b solana_account_info::AccountInfo<'a>>,
1305 miner_usd_ata: Option<&'b solana_account_info::AccountInfo<'a>>,
1306 affiliate: Option<&'b solana_account_info::AccountInfo<'a>>,
1307 sats_vault: Option<&'b solana_account_info::AccountInfo<'a>>,
1308 btc_mint: Option<&'b solana_account_info::AccountInfo<'a>>,
1309 usd_mint: Option<&'b solana_account_info::AccountInfo<'a>>,
1310 board_usd_ata: Option<&'b solana_account_info::AccountInfo<'a>>,
1311 board_btc_ata: Option<&'b solana_account_info::AccountInfo<'a>>,
1312 sats_vault_btc_ata: Option<&'b solana_account_info::AccountInfo<'a>>,
1313 token_vault: Option<&'b solana_account_info::AccountInfo<'a>>,
1314 token_program: Option<&'b solana_account_info::AccountInfo<'a>>,
1315 associated_token_program: Option<&'b solana_account_info::AccountInfo<'a>>,
1316 system_program: Option<&'b solana_account_info::AccountInfo<'a>>,
1317 event_authority: Option<&'b solana_account_info::AccountInfo<'a>>,
1318 program: Option<&'b solana_account_info::AccountInfo<'a>>,
1319 __remaining_accounts: Vec<(&'b solana_account_info::AccountInfo<'a>, bool, bool)>,
1321}
1322