1use borsh::BorshSerialize;
9use borsh::BorshDeserialize;
10
11pub const ROTATE_ROUND_DISCRIMINATOR: [u8; 8] = [3, 245, 202, 88, 161, 29, 51, 141];
12
13#[derive(Debug)]
15pub struct RotateRound {
16
17
18 pub authority: solana_address::Address,
19
20
21 pub satrush_config: solana_address::Address,
22 pub board: solana_address::Address,
28 pub current_round: solana_address::Address,
36 pub next_round: solana_address::Address,
43 pub usd_mint: solana_address::Address,
48 pub btc_mint: solana_address::Address,
53 pub board_usd_ata: solana_address::Address,
58 pub board_btc_ata: solana_address::Address,
65 pub epoch_vault: solana_address::Address,
70
71
72 pub epoch_vault_usd_ata: solana_address::Address,
73 pub epoch_vault_btc_ata: solana_address::Address,
79 pub one_btc_vault: solana_address::Address,
84 pub one_btc_vault_usd_ata: solana_address::Address,
90 pub treasury: solana_address::Address,
97
98
99 pub treasury_usd_ata: solana_address::Address,
100 pub round_rotor: solana_address::Address,
108
109
110 pub token_program: solana_address::Address,
111
112
113 pub system_program: solana_address::Address,
114
115
116 pub event_authority: solana_address::Address,
117
118
119 pub program: solana_address::Address,
120 }
121
122impl RotateRound {
123 pub fn instruction(&self) -> solana_instruction::Instruction {
124 self.instruction_with_remaining_accounts(&[])
125 }
126 #[allow(clippy::arithmetic_side_effects)]
127 #[allow(clippy::vec_init_then_push)]
128 pub fn instruction_with_remaining_accounts(&self, remaining_accounts: &[solana_instruction::AccountMeta]) -> solana_instruction::Instruction {
129 let mut accounts = Vec::with_capacity(21+ remaining_accounts.len());
130 accounts.push(solana_instruction::AccountMeta::new(
131 self.authority,
132 true
133 ));
134 accounts.push(solana_instruction::AccountMeta::new_readonly(
135 self.satrush_config,
136 false
137 ));
138 accounts.push(solana_instruction::AccountMeta::new(
139 self.board,
140 false
141 ));
142 accounts.push(solana_instruction::AccountMeta::new(
143 self.current_round,
144 false
145 ));
146 accounts.push(solana_instruction::AccountMeta::new(
147 self.next_round,
148 false
149 ));
150 accounts.push(solana_instruction::AccountMeta::new_readonly(
151 self.usd_mint,
152 false
153 ));
154 accounts.push(solana_instruction::AccountMeta::new_readonly(
155 self.btc_mint,
156 false
157 ));
158 accounts.push(solana_instruction::AccountMeta::new(
159 self.board_usd_ata,
160 false
161 ));
162 accounts.push(solana_instruction::AccountMeta::new(
163 self.board_btc_ata,
164 false
165 ));
166 accounts.push(solana_instruction::AccountMeta::new(
167 self.epoch_vault,
168 false
169 ));
170 accounts.push(solana_instruction::AccountMeta::new(
171 self.epoch_vault_usd_ata,
172 false
173 ));
174 accounts.push(solana_instruction::AccountMeta::new(
175 self.epoch_vault_btc_ata,
176 false
177 ));
178 accounts.push(solana_instruction::AccountMeta::new(
179 self.one_btc_vault,
180 false
181 ));
182 accounts.push(solana_instruction::AccountMeta::new(
183 self.one_btc_vault_usd_ata,
184 false
185 ));
186 accounts.push(solana_instruction::AccountMeta::new(
187 self.treasury,
188 false
189 ));
190 accounts.push(solana_instruction::AccountMeta::new(
191 self.treasury_usd_ata,
192 false
193 ));
194 accounts.push(solana_instruction::AccountMeta::new_readonly(
195 self.round_rotor,
196 false
197 ));
198 accounts.push(solana_instruction::AccountMeta::new_readonly(
199 self.token_program,
200 false
201 ));
202 accounts.push(solana_instruction::AccountMeta::new_readonly(
203 self.system_program,
204 false
205 ));
206 accounts.push(solana_instruction::AccountMeta::new_readonly(
207 self.event_authority,
208 false
209 ));
210 accounts.push(solana_instruction::AccountMeta::new_readonly(
211 self.program,
212 false
213 ));
214 accounts.extend_from_slice(remaining_accounts);
215 let data = RotateRoundInstructionData::new().try_to_vec().unwrap();
216
217 solana_instruction::Instruction {
218 program_id: crate::SATRUSH_ID,
219 accounts,
220 data,
221 }
222 }
223}
224
225#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
226 pub struct RotateRoundInstructionData {
227 discriminator: [u8; 8],
228 }
229
230impl RotateRoundInstructionData {
231 pub fn new() -> Self {
232 Self {
233 discriminator: [3, 245, 202, 88, 161, 29, 51, 141],
234 }
235 }
236
237 pub(crate) fn try_to_vec(&self) -> Result<Vec<u8>, std::io::Error> {
238 borsh::to_vec(self)
239 }
240 }
241
242impl Default for RotateRoundInstructionData {
243 fn default() -> Self {
244 Self::new()
245 }
246}
247
248
249
250#[derive(Clone, Debug, Default)]
276pub struct RotateRoundBuilder {
277 authority: Option<solana_address::Address>,
278 satrush_config: Option<solana_address::Address>,
279 board: Option<solana_address::Address>,
280 current_round: Option<solana_address::Address>,
281 next_round: Option<solana_address::Address>,
282 usd_mint: Option<solana_address::Address>,
283 btc_mint: Option<solana_address::Address>,
284 board_usd_ata: Option<solana_address::Address>,
285 board_btc_ata: Option<solana_address::Address>,
286 epoch_vault: Option<solana_address::Address>,
287 epoch_vault_usd_ata: Option<solana_address::Address>,
288 epoch_vault_btc_ata: Option<solana_address::Address>,
289 one_btc_vault: Option<solana_address::Address>,
290 one_btc_vault_usd_ata: Option<solana_address::Address>,
291 treasury: Option<solana_address::Address>,
292 treasury_usd_ata: Option<solana_address::Address>,
293 round_rotor: Option<solana_address::Address>,
294 token_program: Option<solana_address::Address>,
295 system_program: Option<solana_address::Address>,
296 event_authority: Option<solana_address::Address>,
297 program: Option<solana_address::Address>,
298 __remaining_accounts: Vec<solana_instruction::AccountMeta>,
299}
300
301impl RotateRoundBuilder {
302 pub fn new() -> Self {
303 Self::default()
304 }
305 #[inline(always)]
306 pub fn authority(&mut self, authority: solana_address::Address) -> &mut Self {
307 self.authority = Some(authority);
308 self
309 }
310 #[inline(always)]
311 pub fn satrush_config(&mut self, satrush_config: solana_address::Address) -> &mut Self {
312 self.satrush_config = Some(satrush_config);
313 self
314 }
315 #[inline(always)]
318 pub fn board(&mut self, board: solana_address::Address) -> &mut Self {
319 self.board = Some(board);
320 self
321 }
322 #[inline(always)]
327 pub fn current_round(&mut self, current_round: solana_address::Address) -> &mut Self {
328 self.current_round = Some(current_round);
329 self
330 }
331 #[inline(always)]
335 pub fn next_round(&mut self, next_round: solana_address::Address) -> &mut Self {
336 self.next_round = Some(next_round);
337 self
338 }
339 #[inline(always)]
341 pub fn usd_mint(&mut self, usd_mint: solana_address::Address) -> &mut Self {
342 self.usd_mint = Some(usd_mint);
343 self
344 }
345 #[inline(always)]
347 pub fn btc_mint(&mut self, btc_mint: solana_address::Address) -> &mut Self {
348 self.btc_mint = Some(btc_mint);
349 self
350 }
351 #[inline(always)]
353 pub fn board_usd_ata(&mut self, board_usd_ata: solana_address::Address) -> &mut Self {
354 self.board_usd_ata = Some(board_usd_ata);
355 self
356 }
357 #[inline(always)]
361 pub fn board_btc_ata(&mut self, board_btc_ata: solana_address::Address) -> &mut Self {
362 self.board_btc_ata = Some(board_btc_ata);
363 self
364 }
365 #[inline(always)]
367 pub fn epoch_vault(&mut self, epoch_vault: solana_address::Address) -> &mut Self {
368 self.epoch_vault = Some(epoch_vault);
369 self
370 }
371 #[inline(always)]
372 pub fn epoch_vault_usd_ata(&mut self, epoch_vault_usd_ata: solana_address::Address) -> &mut Self {
373 self.epoch_vault_usd_ata = Some(epoch_vault_usd_ata);
374 self
375 }
376 #[inline(always)]
379 pub fn epoch_vault_btc_ata(&mut self, epoch_vault_btc_ata: solana_address::Address) -> &mut Self {
380 self.epoch_vault_btc_ata = Some(epoch_vault_btc_ata);
381 self
382 }
383 #[inline(always)]
385 pub fn one_btc_vault(&mut self, one_btc_vault: solana_address::Address) -> &mut Self {
386 self.one_btc_vault = Some(one_btc_vault);
387 self
388 }
389 #[inline(always)]
392 pub fn one_btc_vault_usd_ata(&mut self, one_btc_vault_usd_ata: solana_address::Address) -> &mut Self {
393 self.one_btc_vault_usd_ata = Some(one_btc_vault_usd_ata);
394 self
395 }
396 #[inline(always)]
400 pub fn treasury(&mut self, treasury: solana_address::Address) -> &mut Self {
401 self.treasury = Some(treasury);
402 self
403 }
404 #[inline(always)]
405 pub fn treasury_usd_ata(&mut self, treasury_usd_ata: solana_address::Address) -> &mut Self {
406 self.treasury_usd_ata = Some(treasury_usd_ata);
407 self
408 }
409 #[inline(always)]
415 pub fn round_rotor(&mut self, round_rotor: solana_address::Address) -> &mut Self {
416 self.round_rotor = Some(round_rotor);
417 self
418 }
419 #[inline(always)]
421 pub fn token_program(&mut self, token_program: solana_address::Address) -> &mut Self {
422 self.token_program = Some(token_program);
423 self
424 }
425 #[inline(always)]
427 pub fn system_program(&mut self, system_program: solana_address::Address) -> &mut Self {
428 self.system_program = Some(system_program);
429 self
430 }
431 #[inline(always)]
432 pub fn event_authority(&mut self, event_authority: solana_address::Address) -> &mut Self {
433 self.event_authority = Some(event_authority);
434 self
435 }
436 #[inline(always)]
437 pub fn program(&mut self, program: solana_address::Address) -> &mut Self {
438 self.program = Some(program);
439 self
440 }
441 #[inline(always)]
443 pub fn add_remaining_account(&mut self, account: solana_instruction::AccountMeta) -> &mut Self {
444 self.__remaining_accounts.push(account);
445 self
446 }
447 #[inline(always)]
449 pub fn add_remaining_accounts(&mut self, accounts: &[solana_instruction::AccountMeta]) -> &mut Self {
450 self.__remaining_accounts.extend_from_slice(accounts);
451 self
452 }
453 #[allow(clippy::clone_on_copy)]
454 pub fn instruction(&self) -> solana_instruction::Instruction {
455 let accounts = RotateRound {
456 authority: self.authority.expect("authority is not set"),
457 satrush_config: self.satrush_config.expect("satrush_config is not set"),
458 board: self.board.expect("board is not set"),
459 current_round: self.current_round.expect("current_round is not set"),
460 next_round: self.next_round.expect("next_round is not set"),
461 usd_mint: self.usd_mint.expect("usd_mint is not set"),
462 btc_mint: self.btc_mint.expect("btc_mint is not set"),
463 board_usd_ata: self.board_usd_ata.expect("board_usd_ata is not set"),
464 board_btc_ata: self.board_btc_ata.expect("board_btc_ata is not set"),
465 epoch_vault: self.epoch_vault.expect("epoch_vault is not set"),
466 epoch_vault_usd_ata: self.epoch_vault_usd_ata.expect("epoch_vault_usd_ata is not set"),
467 epoch_vault_btc_ata: self.epoch_vault_btc_ata.expect("epoch_vault_btc_ata is not set"),
468 one_btc_vault: self.one_btc_vault.expect("one_btc_vault is not set"),
469 one_btc_vault_usd_ata: self.one_btc_vault_usd_ata.expect("one_btc_vault_usd_ata is not set"),
470 treasury: self.treasury.expect("treasury is not set"),
471 treasury_usd_ata: self.treasury_usd_ata.expect("treasury_usd_ata is not set"),
472 round_rotor: self.round_rotor.unwrap_or(solana_address::address!("CqkM3g59d36sE563dekRndGAufRQv6mH2BQPUgvS6m6s")),
473 token_program: self.token_program.unwrap_or(solana_address::address!("TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA")),
474 system_program: self.system_program.unwrap_or(solana_address::address!("11111111111111111111111111111111")),
475 event_authority: self.event_authority.expect("event_authority is not set"),
476 program: self.program.expect("program is not set"),
477 };
478
479 accounts.instruction_with_remaining_accounts(&self.__remaining_accounts)
480 }
481}
482
483 pub struct RotateRoundCpiAccounts<'a, 'b> {
485
486
487 pub authority: &'b solana_account_info::AccountInfo<'a>,
488
489
490 pub satrush_config: &'b solana_account_info::AccountInfo<'a>,
491 pub board: &'b solana_account_info::AccountInfo<'a>,
497 pub current_round: &'b solana_account_info::AccountInfo<'a>,
505 pub next_round: &'b solana_account_info::AccountInfo<'a>,
512 pub usd_mint: &'b solana_account_info::AccountInfo<'a>,
517 pub btc_mint: &'b solana_account_info::AccountInfo<'a>,
522 pub board_usd_ata: &'b solana_account_info::AccountInfo<'a>,
527 pub board_btc_ata: &'b solana_account_info::AccountInfo<'a>,
534 pub epoch_vault: &'b solana_account_info::AccountInfo<'a>,
539
540
541 pub epoch_vault_usd_ata: &'b solana_account_info::AccountInfo<'a>,
542 pub epoch_vault_btc_ata: &'b solana_account_info::AccountInfo<'a>,
548 pub one_btc_vault: &'b solana_account_info::AccountInfo<'a>,
553 pub one_btc_vault_usd_ata: &'b solana_account_info::AccountInfo<'a>,
559 pub treasury: &'b solana_account_info::AccountInfo<'a>,
566
567
568 pub treasury_usd_ata: &'b solana_account_info::AccountInfo<'a>,
569 pub round_rotor: &'b solana_account_info::AccountInfo<'a>,
577
578
579 pub token_program: &'b solana_account_info::AccountInfo<'a>,
580
581
582 pub system_program: &'b solana_account_info::AccountInfo<'a>,
583
584
585 pub event_authority: &'b solana_account_info::AccountInfo<'a>,
586
587
588 pub program: &'b solana_account_info::AccountInfo<'a>,
589 }
590
591pub struct RotateRoundCpi<'a, 'b> {
593 pub __program: &'b solana_account_info::AccountInfo<'a>,
595
596
597 pub authority: &'b solana_account_info::AccountInfo<'a>,
598
599
600 pub satrush_config: &'b solana_account_info::AccountInfo<'a>,
601 pub board: &'b solana_account_info::AccountInfo<'a>,
607 pub current_round: &'b solana_account_info::AccountInfo<'a>,
615 pub next_round: &'b solana_account_info::AccountInfo<'a>,
622 pub usd_mint: &'b solana_account_info::AccountInfo<'a>,
627 pub btc_mint: &'b solana_account_info::AccountInfo<'a>,
632 pub board_usd_ata: &'b solana_account_info::AccountInfo<'a>,
637 pub board_btc_ata: &'b solana_account_info::AccountInfo<'a>,
644 pub epoch_vault: &'b solana_account_info::AccountInfo<'a>,
649
650
651 pub epoch_vault_usd_ata: &'b solana_account_info::AccountInfo<'a>,
652 pub epoch_vault_btc_ata: &'b solana_account_info::AccountInfo<'a>,
658 pub one_btc_vault: &'b solana_account_info::AccountInfo<'a>,
663 pub one_btc_vault_usd_ata: &'b solana_account_info::AccountInfo<'a>,
669 pub treasury: &'b solana_account_info::AccountInfo<'a>,
676
677
678 pub treasury_usd_ata: &'b solana_account_info::AccountInfo<'a>,
679 pub round_rotor: &'b solana_account_info::AccountInfo<'a>,
687
688
689 pub token_program: &'b solana_account_info::AccountInfo<'a>,
690
691
692 pub system_program: &'b solana_account_info::AccountInfo<'a>,
693
694
695 pub event_authority: &'b solana_account_info::AccountInfo<'a>,
696
697
698 pub program: &'b solana_account_info::AccountInfo<'a>,
699 }
700
701impl<'a, 'b> RotateRoundCpi<'a, 'b> {
702 pub fn new(
703 program: &'b solana_account_info::AccountInfo<'a>,
704 accounts: RotateRoundCpiAccounts<'a, 'b>,
705 ) -> Self {
706 Self {
707 __program: program,
708 authority: accounts.authority,
709 satrush_config: accounts.satrush_config,
710 board: accounts.board,
711 current_round: accounts.current_round,
712 next_round: accounts.next_round,
713 usd_mint: accounts.usd_mint,
714 btc_mint: accounts.btc_mint,
715 board_usd_ata: accounts.board_usd_ata,
716 board_btc_ata: accounts.board_btc_ata,
717 epoch_vault: accounts.epoch_vault,
718 epoch_vault_usd_ata: accounts.epoch_vault_usd_ata,
719 epoch_vault_btc_ata: accounts.epoch_vault_btc_ata,
720 one_btc_vault: accounts.one_btc_vault,
721 one_btc_vault_usd_ata: accounts.one_btc_vault_usd_ata,
722 treasury: accounts.treasury,
723 treasury_usd_ata: accounts.treasury_usd_ata,
724 round_rotor: accounts.round_rotor,
725 token_program: accounts.token_program,
726 system_program: accounts.system_program,
727 event_authority: accounts.event_authority,
728 program: accounts.program,
729 }
730 }
731 #[inline(always)]
732 pub fn invoke(&self) -> solana_program_error::ProgramResult {
733 self.invoke_signed_with_remaining_accounts(&[], &[])
734 }
735 #[inline(always)]
736 pub fn invoke_with_remaining_accounts(&self, remaining_accounts: &[(&'b solana_account_info::AccountInfo<'a>, bool, bool)]) -> solana_program_error::ProgramResult {
737 self.invoke_signed_with_remaining_accounts(&[], remaining_accounts)
738 }
739 #[inline(always)]
740 pub fn invoke_signed(&self, signers_seeds: &[&[&[u8]]]) -> solana_program_error::ProgramResult {
741 self.invoke_signed_with_remaining_accounts(signers_seeds, &[])
742 }
743 #[allow(clippy::arithmetic_side_effects)]
744 #[allow(clippy::clone_on_copy)]
745 #[allow(clippy::vec_init_then_push)]
746 pub fn invoke_signed_with_remaining_accounts(
747 &self,
748 signers_seeds: &[&[&[u8]]],
749 remaining_accounts: &[(&'b solana_account_info::AccountInfo<'a>, bool, bool)]
750 ) -> solana_program_error::ProgramResult {
751 let mut accounts = Vec::with_capacity(21+ remaining_accounts.len());
752 accounts.push(solana_instruction::AccountMeta::new(
753 *self.authority.key,
754 true
755 ));
756 accounts.push(solana_instruction::AccountMeta::new_readonly(
757 *self.satrush_config.key,
758 false
759 ));
760 accounts.push(solana_instruction::AccountMeta::new(
761 *self.board.key,
762 false
763 ));
764 accounts.push(solana_instruction::AccountMeta::new(
765 *self.current_round.key,
766 false
767 ));
768 accounts.push(solana_instruction::AccountMeta::new(
769 *self.next_round.key,
770 false
771 ));
772 accounts.push(solana_instruction::AccountMeta::new_readonly(
773 *self.usd_mint.key,
774 false
775 ));
776 accounts.push(solana_instruction::AccountMeta::new_readonly(
777 *self.btc_mint.key,
778 false
779 ));
780 accounts.push(solana_instruction::AccountMeta::new(
781 *self.board_usd_ata.key,
782 false
783 ));
784 accounts.push(solana_instruction::AccountMeta::new(
785 *self.board_btc_ata.key,
786 false
787 ));
788 accounts.push(solana_instruction::AccountMeta::new(
789 *self.epoch_vault.key,
790 false
791 ));
792 accounts.push(solana_instruction::AccountMeta::new(
793 *self.epoch_vault_usd_ata.key,
794 false
795 ));
796 accounts.push(solana_instruction::AccountMeta::new(
797 *self.epoch_vault_btc_ata.key,
798 false
799 ));
800 accounts.push(solana_instruction::AccountMeta::new(
801 *self.one_btc_vault.key,
802 false
803 ));
804 accounts.push(solana_instruction::AccountMeta::new(
805 *self.one_btc_vault_usd_ata.key,
806 false
807 ));
808 accounts.push(solana_instruction::AccountMeta::new(
809 *self.treasury.key,
810 false
811 ));
812 accounts.push(solana_instruction::AccountMeta::new(
813 *self.treasury_usd_ata.key,
814 false
815 ));
816 accounts.push(solana_instruction::AccountMeta::new_readonly(
817 *self.round_rotor.key,
818 false
819 ));
820 accounts.push(solana_instruction::AccountMeta::new_readonly(
821 *self.token_program.key,
822 false
823 ));
824 accounts.push(solana_instruction::AccountMeta::new_readonly(
825 *self.system_program.key,
826 false
827 ));
828 accounts.push(solana_instruction::AccountMeta::new_readonly(
829 *self.event_authority.key,
830 false
831 ));
832 accounts.push(solana_instruction::AccountMeta::new_readonly(
833 *self.program.key,
834 false
835 ));
836 remaining_accounts.iter().for_each(|remaining_account| {
837 accounts.push(solana_instruction::AccountMeta {
838 pubkey: *remaining_account.0.key,
839 is_signer: remaining_account.1,
840 is_writable: remaining_account.2,
841 })
842 });
843 let data = RotateRoundInstructionData::new().try_to_vec().unwrap();
844
845 let instruction = solana_instruction::Instruction {
846 program_id: crate::SATRUSH_ID,
847 accounts,
848 data,
849 };
850 let mut account_infos = Vec::with_capacity(22 + remaining_accounts.len());
851 account_infos.push(self.__program.clone());
852 account_infos.push(self.authority.clone());
853 account_infos.push(self.satrush_config.clone());
854 account_infos.push(self.board.clone());
855 account_infos.push(self.current_round.clone());
856 account_infos.push(self.next_round.clone());
857 account_infos.push(self.usd_mint.clone());
858 account_infos.push(self.btc_mint.clone());
859 account_infos.push(self.board_usd_ata.clone());
860 account_infos.push(self.board_btc_ata.clone());
861 account_infos.push(self.epoch_vault.clone());
862 account_infos.push(self.epoch_vault_usd_ata.clone());
863 account_infos.push(self.epoch_vault_btc_ata.clone());
864 account_infos.push(self.one_btc_vault.clone());
865 account_infos.push(self.one_btc_vault_usd_ata.clone());
866 account_infos.push(self.treasury.clone());
867 account_infos.push(self.treasury_usd_ata.clone());
868 account_infos.push(self.round_rotor.clone());
869 account_infos.push(self.token_program.clone());
870 account_infos.push(self.system_program.clone());
871 account_infos.push(self.event_authority.clone());
872 account_infos.push(self.program.clone());
873 remaining_accounts.iter().for_each(|remaining_account| account_infos.push(remaining_account.0.clone()));
874
875 if signers_seeds.is_empty() {
876 solana_cpi::invoke(&instruction, &account_infos)
877 } else {
878 solana_cpi::invoke_signed(&instruction, &account_infos, signers_seeds)
879 }
880 }
881}
882
883#[derive(Clone, Debug)]
909pub struct RotateRoundCpiBuilder<'a, 'b> {
910 instruction: Box<RotateRoundCpiBuilderInstruction<'a, 'b>>,
911}
912
913impl<'a, 'b> RotateRoundCpiBuilder<'a, 'b> {
914 pub fn new(program: &'b solana_account_info::AccountInfo<'a>) -> Self {
915 let instruction = Box::new(RotateRoundCpiBuilderInstruction {
916 __program: program,
917 authority: None,
918 satrush_config: None,
919 board: None,
920 current_round: None,
921 next_round: None,
922 usd_mint: None,
923 btc_mint: None,
924 board_usd_ata: None,
925 board_btc_ata: None,
926 epoch_vault: None,
927 epoch_vault_usd_ata: None,
928 epoch_vault_btc_ata: None,
929 one_btc_vault: None,
930 one_btc_vault_usd_ata: None,
931 treasury: None,
932 treasury_usd_ata: None,
933 round_rotor: None,
934 token_program: None,
935 system_program: None,
936 event_authority: None,
937 program: None,
938 __remaining_accounts: Vec::new(),
939 });
940 Self { instruction }
941 }
942 #[inline(always)]
943 pub fn authority(&mut self, authority: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
944 self.instruction.authority = Some(authority);
945 self
946 }
947 #[inline(always)]
948 pub fn satrush_config(&mut self, satrush_config: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
949 self.instruction.satrush_config = Some(satrush_config);
950 self
951 }
952 #[inline(always)]
955 pub fn board(&mut self, board: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
956 self.instruction.board = Some(board);
957 self
958 }
959 #[inline(always)]
964 pub fn current_round(&mut self, current_round: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
965 self.instruction.current_round = Some(current_round);
966 self
967 }
968 #[inline(always)]
972 pub fn next_round(&mut self, next_round: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
973 self.instruction.next_round = Some(next_round);
974 self
975 }
976 #[inline(always)]
978 pub fn usd_mint(&mut self, usd_mint: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
979 self.instruction.usd_mint = Some(usd_mint);
980 self
981 }
982 #[inline(always)]
984 pub fn btc_mint(&mut self, btc_mint: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
985 self.instruction.btc_mint = Some(btc_mint);
986 self
987 }
988 #[inline(always)]
990 pub fn board_usd_ata(&mut self, board_usd_ata: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
991 self.instruction.board_usd_ata = Some(board_usd_ata);
992 self
993 }
994 #[inline(always)]
998 pub fn board_btc_ata(&mut self, board_btc_ata: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
999 self.instruction.board_btc_ata = Some(board_btc_ata);
1000 self
1001 }
1002 #[inline(always)]
1004 pub fn epoch_vault(&mut self, epoch_vault: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
1005 self.instruction.epoch_vault = Some(epoch_vault);
1006 self
1007 }
1008 #[inline(always)]
1009 pub fn epoch_vault_usd_ata(&mut self, epoch_vault_usd_ata: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
1010 self.instruction.epoch_vault_usd_ata = Some(epoch_vault_usd_ata);
1011 self
1012 }
1013 #[inline(always)]
1016 pub fn epoch_vault_btc_ata(&mut self, epoch_vault_btc_ata: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
1017 self.instruction.epoch_vault_btc_ata = Some(epoch_vault_btc_ata);
1018 self
1019 }
1020 #[inline(always)]
1022 pub fn one_btc_vault(&mut self, one_btc_vault: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
1023 self.instruction.one_btc_vault = Some(one_btc_vault);
1024 self
1025 }
1026 #[inline(always)]
1029 pub fn one_btc_vault_usd_ata(&mut self, one_btc_vault_usd_ata: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
1030 self.instruction.one_btc_vault_usd_ata = Some(one_btc_vault_usd_ata);
1031 self
1032 }
1033 #[inline(always)]
1037 pub fn treasury(&mut self, treasury: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
1038 self.instruction.treasury = Some(treasury);
1039 self
1040 }
1041 #[inline(always)]
1042 pub fn treasury_usd_ata(&mut self, treasury_usd_ata: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
1043 self.instruction.treasury_usd_ata = Some(treasury_usd_ata);
1044 self
1045 }
1046 #[inline(always)]
1051 pub fn round_rotor(&mut self, round_rotor: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
1052 self.instruction.round_rotor = Some(round_rotor);
1053 self
1054 }
1055 #[inline(always)]
1056 pub fn token_program(&mut self, token_program: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
1057 self.instruction.token_program = Some(token_program);
1058 self
1059 }
1060 #[inline(always)]
1061 pub fn system_program(&mut self, system_program: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
1062 self.instruction.system_program = Some(system_program);
1063 self
1064 }
1065 #[inline(always)]
1066 pub fn event_authority(&mut self, event_authority: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
1067 self.instruction.event_authority = Some(event_authority);
1068 self
1069 }
1070 #[inline(always)]
1071 pub fn program(&mut self, program: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
1072 self.instruction.program = Some(program);
1073 self
1074 }
1075 #[inline(always)]
1077 pub fn add_remaining_account(&mut self, account: &'b solana_account_info::AccountInfo<'a>, is_writable: bool, is_signer: bool) -> &mut Self {
1078 self.instruction.__remaining_accounts.push((account, is_writable, is_signer));
1079 self
1080 }
1081 #[inline(always)]
1086 pub fn add_remaining_accounts(&mut self, accounts: &[(&'b solana_account_info::AccountInfo<'a>, bool, bool)]) -> &mut Self {
1087 self.instruction.__remaining_accounts.extend_from_slice(accounts);
1088 self
1089 }
1090 #[inline(always)]
1091 pub fn invoke(&self) -> solana_program_error::ProgramResult {
1092 self.invoke_signed(&[])
1093 }
1094 #[allow(clippy::clone_on_copy)]
1095 #[allow(clippy::vec_init_then_push)]
1096 pub fn invoke_signed(&self, signers_seeds: &[&[&[u8]]]) -> solana_program_error::ProgramResult {
1097 let instruction = RotateRoundCpi {
1098 __program: self.instruction.__program,
1099
1100 authority: self.instruction.authority.expect("authority is not set"),
1101
1102 satrush_config: self.instruction.satrush_config.expect("satrush_config is not set"),
1103
1104 board: self.instruction.board.expect("board is not set"),
1105
1106 current_round: self.instruction.current_round.expect("current_round is not set"),
1107
1108 next_round: self.instruction.next_round.expect("next_round is not set"),
1109
1110 usd_mint: self.instruction.usd_mint.expect("usd_mint is not set"),
1111
1112 btc_mint: self.instruction.btc_mint.expect("btc_mint is not set"),
1113
1114 board_usd_ata: self.instruction.board_usd_ata.expect("board_usd_ata is not set"),
1115
1116 board_btc_ata: self.instruction.board_btc_ata.expect("board_btc_ata is not set"),
1117
1118 epoch_vault: self.instruction.epoch_vault.expect("epoch_vault is not set"),
1119
1120 epoch_vault_usd_ata: self.instruction.epoch_vault_usd_ata.expect("epoch_vault_usd_ata is not set"),
1121
1122 epoch_vault_btc_ata: self.instruction.epoch_vault_btc_ata.expect("epoch_vault_btc_ata is not set"),
1123
1124 one_btc_vault: self.instruction.one_btc_vault.expect("one_btc_vault is not set"),
1125
1126 one_btc_vault_usd_ata: self.instruction.one_btc_vault_usd_ata.expect("one_btc_vault_usd_ata is not set"),
1127
1128 treasury: self.instruction.treasury.expect("treasury is not set"),
1129
1130 treasury_usd_ata: self.instruction.treasury_usd_ata.expect("treasury_usd_ata is not set"),
1131
1132 round_rotor: self.instruction.round_rotor.expect("round_rotor is not set"),
1133
1134 token_program: self.instruction.token_program.expect("token_program is not set"),
1135
1136 system_program: self.instruction.system_program.expect("system_program is not set"),
1137
1138 event_authority: self.instruction.event_authority.expect("event_authority is not set"),
1139
1140 program: self.instruction.program.expect("program is not set"),
1141 };
1142 instruction.invoke_signed_with_remaining_accounts(signers_seeds, &self.instruction.__remaining_accounts)
1143 }
1144}
1145
1146#[derive(Clone, Debug)]
1147struct RotateRoundCpiBuilderInstruction<'a, 'b> {
1148 __program: &'b solana_account_info::AccountInfo<'a>,
1149 authority: Option<&'b solana_account_info::AccountInfo<'a>>,
1150 satrush_config: Option<&'b solana_account_info::AccountInfo<'a>>,
1151 board: Option<&'b solana_account_info::AccountInfo<'a>>,
1152 current_round: Option<&'b solana_account_info::AccountInfo<'a>>,
1153 next_round: Option<&'b solana_account_info::AccountInfo<'a>>,
1154 usd_mint: Option<&'b solana_account_info::AccountInfo<'a>>,
1155 btc_mint: Option<&'b solana_account_info::AccountInfo<'a>>,
1156 board_usd_ata: Option<&'b solana_account_info::AccountInfo<'a>>,
1157 board_btc_ata: Option<&'b solana_account_info::AccountInfo<'a>>,
1158 epoch_vault: Option<&'b solana_account_info::AccountInfo<'a>>,
1159 epoch_vault_usd_ata: Option<&'b solana_account_info::AccountInfo<'a>>,
1160 epoch_vault_btc_ata: Option<&'b solana_account_info::AccountInfo<'a>>,
1161 one_btc_vault: Option<&'b solana_account_info::AccountInfo<'a>>,
1162 one_btc_vault_usd_ata: Option<&'b solana_account_info::AccountInfo<'a>>,
1163 treasury: Option<&'b solana_account_info::AccountInfo<'a>>,
1164 treasury_usd_ata: Option<&'b solana_account_info::AccountInfo<'a>>,
1165 round_rotor: Option<&'b solana_account_info::AccountInfo<'a>>,
1166 token_program: Option<&'b solana_account_info::AccountInfo<'a>>,
1167 system_program: Option<&'b solana_account_info::AccountInfo<'a>>,
1168 event_authority: Option<&'b solana_account_info::AccountInfo<'a>>,
1169 program: Option<&'b solana_account_info::AccountInfo<'a>>,
1170 __remaining_accounts: Vec<(&'b solana_account_info::AccountInfo<'a>, bool, bool)>,
1172}
1173