Skip to main content

satrush_client/generated/instructions/
swap_round_stake.rs

1//! This code was AUTOGENERATED using the codama library.
2//! Please DO NOT EDIT THIS FILE, instead use visitors
3//! to add features, then rerun codama to update it.
4//!
5//! <https://github.com/codama-idl/codama>
6//!
7
8use borsh::BorshSerialize;
9use borsh::BorshDeserialize;
10
11pub const SWAP_ROUND_STAKE_DISCRIMINATOR: [u8; 8] = [86, 168, 42, 98, 2, 164, 250, 185];
12
13/// Accounts.
14#[derive(Debug)]
15pub struct SwapRoundStake {
16            /// The round authority keeper that built the off-chain route.
17
18    
19              
20          pub authority: solana_address::Address,
21          
22              
23          pub satrush_config: solana_address::Address,
24                /// PDA that owns the token pools and signs the swap CPI.
25
26    
27              
28          pub board: solana_address::Address,
29                /// The revealed round whose stake is being swapped.
30
31    
32              
33          pub round: solana_address::Address,
34          
35              
36          pub usd_mint: solana_address::Address,
37          
38              
39          pub btc_mint: solana_address::Address,
40                /// Board's USD deposit pool — the swap source.
41
42    
43              
44          pub board_usd_ata: solana_address::Address,
45                /// Board's BTC reserves — the swap destination.
46
47    
48              
49          pub board_btc_ata: solana_address::Address,
50                /// hardcoded `SWAP_PROGRAM` (mock under the `devnet` feature).
51
52    
53              
54          pub swap_program: solana_address::Address,
55          
56              
57          pub token_program: solana_address::Address,
58      }
59
60impl SwapRoundStake {
61  pub fn instruction(&self, args: SwapRoundStakeInstructionArgs) -> solana_instruction::Instruction {
62    self.instruction_with_remaining_accounts(args, &[])
63  }
64  #[allow(clippy::arithmetic_side_effects)]
65  #[allow(clippy::vec_init_then_push)]
66  pub fn instruction_with_remaining_accounts(&self, args: SwapRoundStakeInstructionArgs, remaining_accounts: &[solana_instruction::AccountMeta]) -> solana_instruction::Instruction {
67    let mut accounts = Vec::with_capacity(10+ remaining_accounts.len());
68                            accounts.push(solana_instruction::AccountMeta::new_readonly(
69            self.authority,
70            true
71          ));
72                                          accounts.push(solana_instruction::AccountMeta::new_readonly(
73            self.satrush_config,
74            false
75          ));
76                                          accounts.push(solana_instruction::AccountMeta::new_readonly(
77            self.board,
78            false
79          ));
80                                          accounts.push(solana_instruction::AccountMeta::new(
81            self.round,
82            false
83          ));
84                                          accounts.push(solana_instruction::AccountMeta::new_readonly(
85            self.usd_mint,
86            false
87          ));
88                                          accounts.push(solana_instruction::AccountMeta::new_readonly(
89            self.btc_mint,
90            false
91          ));
92                                          accounts.push(solana_instruction::AccountMeta::new(
93            self.board_usd_ata,
94            false
95          ));
96                                          accounts.push(solana_instruction::AccountMeta::new(
97            self.board_btc_ata,
98            false
99          ));
100                                          accounts.push(solana_instruction::AccountMeta::new_readonly(
101            self.swap_program,
102            false
103          ));
104                                          accounts.push(solana_instruction::AccountMeta::new_readonly(
105            self.token_program,
106            false
107          ));
108                      accounts.extend_from_slice(remaining_accounts);
109    let mut data = SwapRoundStakeInstructionData::new().try_to_vec().unwrap();
110          let mut args = args.try_to_vec().unwrap();
111      data.append(&mut args);
112    
113    solana_instruction::Instruction {
114      program_id: crate::SATRUSH_ID,
115      accounts,
116      data,
117    }
118  }
119}
120
121#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
122 pub struct SwapRoundStakeInstructionData {
123            discriminator: [u8; 8],
124                  }
125
126impl SwapRoundStakeInstructionData {
127  pub fn new() -> Self {
128    Self {
129                        discriminator: [86, 168, 42, 98, 2, 164, 250, 185],
130                                              }
131  }
132
133    pub(crate) fn try_to_vec(&self) -> Result<Vec<u8>, std::io::Error> {
134    borsh::to_vec(self)
135  }
136  }
137
138impl Default for SwapRoundStakeInstructionData {
139  fn default() -> Self {
140    Self::new()
141  }
142}
143
144#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
145 pub struct SwapRoundStakeInstructionArgs {
146                  pub min_btc_out: u64,
147                pub swap_data: Vec<u8>,
148      }
149
150impl SwapRoundStakeInstructionArgs {
151  pub(crate) fn try_to_vec(&self) -> Result<Vec<u8>, std::io::Error> {
152    borsh::to_vec(self)
153  }
154}
155
156
157/// Instruction builder for `SwapRoundStake`.
158///
159/// ### Accounts:
160///
161                ///   0. `[signer]` authority
162          ///   1. `[]` satrush_config
163          ///   2. `[]` board
164                ///   3. `[writable]` round
165          ///   4. `[]` usd_mint
166          ///   5. `[]` btc_mint
167                ///   6. `[writable]` board_usd_ata
168                ///   7. `[writable]` board_btc_ata
169                ///   8. `[optional]` swap_program (default to `JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4`)
170                ///   9. `[optional]` token_program (default to `TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA`)
171#[derive(Clone, Debug, Default)]
172pub struct SwapRoundStakeBuilder {
173            authority: Option<solana_address::Address>,
174                satrush_config: Option<solana_address::Address>,
175                board: Option<solana_address::Address>,
176                round: Option<solana_address::Address>,
177                usd_mint: Option<solana_address::Address>,
178                btc_mint: Option<solana_address::Address>,
179                board_usd_ata: Option<solana_address::Address>,
180                board_btc_ata: Option<solana_address::Address>,
181                swap_program: Option<solana_address::Address>,
182                token_program: Option<solana_address::Address>,
183                        min_btc_out: Option<u64>,
184                swap_data: Option<Vec<u8>>,
185        __remaining_accounts: Vec<solana_instruction::AccountMeta>,
186}
187
188impl SwapRoundStakeBuilder {
189  pub fn new() -> Self {
190    Self::default()
191  }
192            /// The round authority keeper that built the off-chain route.
193#[inline(always)]
194    pub fn authority(&mut self, authority: solana_address::Address) -> &mut Self {
195                        self.authority = Some(authority);
196                    self
197    }
198            #[inline(always)]
199    pub fn satrush_config(&mut self, satrush_config: solana_address::Address) -> &mut Self {
200                        self.satrush_config = Some(satrush_config);
201                    self
202    }
203            /// PDA that owns the token pools and signs the swap CPI.
204#[inline(always)]
205    pub fn board(&mut self, board: solana_address::Address) -> &mut Self {
206                        self.board = Some(board);
207                    self
208    }
209            /// The revealed round whose stake is being swapped.
210#[inline(always)]
211    pub fn round(&mut self, round: solana_address::Address) -> &mut Self {
212                        self.round = Some(round);
213                    self
214    }
215            #[inline(always)]
216    pub fn usd_mint(&mut self, usd_mint: solana_address::Address) -> &mut Self {
217                        self.usd_mint = Some(usd_mint);
218                    self
219    }
220            #[inline(always)]
221    pub fn btc_mint(&mut self, btc_mint: solana_address::Address) -> &mut Self {
222                        self.btc_mint = Some(btc_mint);
223                    self
224    }
225            /// Board's USD deposit pool — the swap source.
226#[inline(always)]
227    pub fn board_usd_ata(&mut self, board_usd_ata: solana_address::Address) -> &mut Self {
228                        self.board_usd_ata = Some(board_usd_ata);
229                    self
230    }
231            /// Board's BTC reserves — the swap destination.
232#[inline(always)]
233    pub fn board_btc_ata(&mut self, board_btc_ata: solana_address::Address) -> &mut Self {
234                        self.board_btc_ata = Some(board_btc_ata);
235                    self
236    }
237            /// `[optional account, default to 'JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4']`
238/// hardcoded `SWAP_PROGRAM` (mock under the `devnet` feature).
239#[inline(always)]
240    pub fn swap_program(&mut self, swap_program: solana_address::Address) -> &mut Self {
241                        self.swap_program = Some(swap_program);
242                    self
243    }
244            /// `[optional account, default to 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA']`
245#[inline(always)]
246    pub fn token_program(&mut self, token_program: solana_address::Address) -> &mut Self {
247                        self.token_program = Some(token_program);
248                    self
249    }
250                    #[inline(always)]
251      pub fn min_btc_out(&mut self, min_btc_out: u64) -> &mut Self {
252        self.min_btc_out = Some(min_btc_out);
253        self
254      }
255                #[inline(always)]
256      pub fn swap_data(&mut self, swap_data: Vec<u8>) -> &mut Self {
257        self.swap_data = Some(swap_data);
258        self
259      }
260        /// Add an additional account to the instruction.
261  #[inline(always)]
262  pub fn add_remaining_account(&mut self, account: solana_instruction::AccountMeta) -> &mut Self {
263    self.__remaining_accounts.push(account);
264    self
265  }
266  /// Add additional accounts to the instruction.
267  #[inline(always)]
268  pub fn add_remaining_accounts(&mut self, accounts: &[solana_instruction::AccountMeta]) -> &mut Self {
269    self.__remaining_accounts.extend_from_slice(accounts);
270    self
271  }
272  #[allow(clippy::clone_on_copy)]
273  pub fn instruction(&self) -> solana_instruction::Instruction {
274    let accounts = SwapRoundStake {
275                              authority: self.authority.expect("authority is not set"),
276                                        satrush_config: self.satrush_config.expect("satrush_config is not set"),
277                                        board: self.board.expect("board is not set"),
278                                        round: self.round.expect("round is not set"),
279                                        usd_mint: self.usd_mint.expect("usd_mint is not set"),
280                                        btc_mint: self.btc_mint.expect("btc_mint is not set"),
281                                        board_usd_ata: self.board_usd_ata.expect("board_usd_ata is not set"),
282                                        board_btc_ata: self.board_btc_ata.expect("board_btc_ata is not set"),
283                                        swap_program: self.swap_program.unwrap_or(solana_address::address!("JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4")),
284                                        token_program: self.token_program.unwrap_or(solana_address::address!("TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA")),
285                      };
286          let args = SwapRoundStakeInstructionArgs {
287                                                              min_btc_out: self.min_btc_out.clone().expect("min_btc_out is not set"),
288                                                                  swap_data: self.swap_data.clone().expect("swap_data is not set"),
289                                    };
290    
291    accounts.instruction_with_remaining_accounts(args, &self.__remaining_accounts)
292  }
293}
294
295  /// `swap_round_stake` CPI accounts.
296  pub struct SwapRoundStakeCpiAccounts<'a, 'b> {
297                  /// The round authority keeper that built the off-chain route.
298
299      
300                    
301              pub authority: &'b solana_account_info::AccountInfo<'a>,
302                
303                    
304              pub satrush_config: &'b solana_account_info::AccountInfo<'a>,
305                        /// PDA that owns the token pools and signs the swap CPI.
306
307      
308                    
309              pub board: &'b solana_account_info::AccountInfo<'a>,
310                        /// The revealed round whose stake is being swapped.
311
312      
313                    
314              pub round: &'b solana_account_info::AccountInfo<'a>,
315                
316                    
317              pub usd_mint: &'b solana_account_info::AccountInfo<'a>,
318                
319                    
320              pub btc_mint: &'b solana_account_info::AccountInfo<'a>,
321                        /// Board's USD deposit pool — the swap source.
322
323      
324                    
325              pub board_usd_ata: &'b solana_account_info::AccountInfo<'a>,
326                        /// Board's BTC reserves — the swap destination.
327
328      
329                    
330              pub board_btc_ata: &'b solana_account_info::AccountInfo<'a>,
331                        /// hardcoded `SWAP_PROGRAM` (mock under the `devnet` feature).
332
333      
334                    
335              pub swap_program: &'b solana_account_info::AccountInfo<'a>,
336                
337                    
338              pub token_program: &'b solana_account_info::AccountInfo<'a>,
339            }
340
341/// `swap_round_stake` CPI instruction.
342pub struct SwapRoundStakeCpi<'a, 'b> {
343  /// The program to invoke.
344  pub __program: &'b solana_account_info::AccountInfo<'a>,
345            /// The round authority keeper that built the off-chain route.
346
347    
348              
349          pub authority: &'b solana_account_info::AccountInfo<'a>,
350          
351              
352          pub satrush_config: &'b solana_account_info::AccountInfo<'a>,
353                /// PDA that owns the token pools and signs the swap CPI.
354
355    
356              
357          pub board: &'b solana_account_info::AccountInfo<'a>,
358                /// The revealed round whose stake is being swapped.
359
360    
361              
362          pub round: &'b solana_account_info::AccountInfo<'a>,
363          
364              
365          pub usd_mint: &'b solana_account_info::AccountInfo<'a>,
366          
367              
368          pub btc_mint: &'b solana_account_info::AccountInfo<'a>,
369                /// Board's USD deposit pool — the swap source.
370
371    
372              
373          pub board_usd_ata: &'b solana_account_info::AccountInfo<'a>,
374                /// Board's BTC reserves — the swap destination.
375
376    
377              
378          pub board_btc_ata: &'b solana_account_info::AccountInfo<'a>,
379                /// hardcoded `SWAP_PROGRAM` (mock under the `devnet` feature).
380
381    
382              
383          pub swap_program: &'b solana_account_info::AccountInfo<'a>,
384          
385              
386          pub token_program: &'b solana_account_info::AccountInfo<'a>,
387            /// The arguments for the instruction.
388    pub __args: SwapRoundStakeInstructionArgs,
389  }
390
391impl<'a, 'b> SwapRoundStakeCpi<'a, 'b> {
392  pub fn new(
393    program: &'b solana_account_info::AccountInfo<'a>,
394          accounts: SwapRoundStakeCpiAccounts<'a, 'b>,
395              args: SwapRoundStakeInstructionArgs,
396      ) -> Self {
397    Self {
398      __program: program,
399              authority: accounts.authority,
400              satrush_config: accounts.satrush_config,
401              board: accounts.board,
402              round: accounts.round,
403              usd_mint: accounts.usd_mint,
404              btc_mint: accounts.btc_mint,
405              board_usd_ata: accounts.board_usd_ata,
406              board_btc_ata: accounts.board_btc_ata,
407              swap_program: accounts.swap_program,
408              token_program: accounts.token_program,
409                    __args: args,
410          }
411  }
412  #[inline(always)]
413  pub fn invoke(&self) -> solana_program_error::ProgramResult {
414    self.invoke_signed_with_remaining_accounts(&[], &[])
415  }
416  #[inline(always)]
417  pub fn invoke_with_remaining_accounts(&self, remaining_accounts: &[(&'b solana_account_info::AccountInfo<'a>, bool, bool)]) -> solana_program_error::ProgramResult {
418    self.invoke_signed_with_remaining_accounts(&[], remaining_accounts)
419  }
420  #[inline(always)]
421  pub fn invoke_signed(&self, signers_seeds: &[&[&[u8]]]) -> solana_program_error::ProgramResult {
422    self.invoke_signed_with_remaining_accounts(signers_seeds, &[])
423  }
424  #[allow(clippy::arithmetic_side_effects)]
425  #[allow(clippy::clone_on_copy)]
426  #[allow(clippy::vec_init_then_push)]
427  pub fn invoke_signed_with_remaining_accounts(
428    &self,
429    signers_seeds: &[&[&[u8]]],
430    remaining_accounts: &[(&'b solana_account_info::AccountInfo<'a>, bool, bool)]
431  ) -> solana_program_error::ProgramResult {
432    let mut accounts = Vec::with_capacity(10+ remaining_accounts.len());
433                            accounts.push(solana_instruction::AccountMeta::new_readonly(
434            *self.authority.key,
435            true
436          ));
437                                          accounts.push(solana_instruction::AccountMeta::new_readonly(
438            *self.satrush_config.key,
439            false
440          ));
441                                          accounts.push(solana_instruction::AccountMeta::new_readonly(
442            *self.board.key,
443            false
444          ));
445                                          accounts.push(solana_instruction::AccountMeta::new(
446            *self.round.key,
447            false
448          ));
449                                          accounts.push(solana_instruction::AccountMeta::new_readonly(
450            *self.usd_mint.key,
451            false
452          ));
453                                          accounts.push(solana_instruction::AccountMeta::new_readonly(
454            *self.btc_mint.key,
455            false
456          ));
457                                          accounts.push(solana_instruction::AccountMeta::new(
458            *self.board_usd_ata.key,
459            false
460          ));
461                                          accounts.push(solana_instruction::AccountMeta::new(
462            *self.board_btc_ata.key,
463            false
464          ));
465                                          accounts.push(solana_instruction::AccountMeta::new_readonly(
466            *self.swap_program.key,
467            false
468          ));
469                                          accounts.push(solana_instruction::AccountMeta::new_readonly(
470            *self.token_program.key,
471            false
472          ));
473                      remaining_accounts.iter().for_each(|remaining_account| {
474      accounts.push(solana_instruction::AccountMeta {
475          pubkey: *remaining_account.0.key,
476          is_signer: remaining_account.1,
477          is_writable: remaining_account.2,
478      })
479    });
480    let mut data = SwapRoundStakeInstructionData::new().try_to_vec().unwrap();
481          let mut args = self.__args.try_to_vec().unwrap();
482      data.append(&mut args);
483    
484    let instruction = solana_instruction::Instruction {
485      program_id: crate::SATRUSH_ID,
486      accounts,
487      data,
488    };
489    let mut account_infos = Vec::with_capacity(11 + remaining_accounts.len());
490    account_infos.push(self.__program.clone());
491                  account_infos.push(self.authority.clone());
492                        account_infos.push(self.satrush_config.clone());
493                        account_infos.push(self.board.clone());
494                        account_infos.push(self.round.clone());
495                        account_infos.push(self.usd_mint.clone());
496                        account_infos.push(self.btc_mint.clone());
497                        account_infos.push(self.board_usd_ata.clone());
498                        account_infos.push(self.board_btc_ata.clone());
499                        account_infos.push(self.swap_program.clone());
500                        account_infos.push(self.token_program.clone());
501              remaining_accounts.iter().for_each(|remaining_account| account_infos.push(remaining_account.0.clone()));
502
503    if signers_seeds.is_empty() {
504      solana_cpi::invoke(&instruction, &account_infos)
505    } else {
506      solana_cpi::invoke_signed(&instruction, &account_infos, signers_seeds)
507    }
508  }
509}
510
511/// Instruction builder for `SwapRoundStake` via CPI.
512///
513/// ### Accounts:
514///
515                ///   0. `[signer]` authority
516          ///   1. `[]` satrush_config
517          ///   2. `[]` board
518                ///   3. `[writable]` round
519          ///   4. `[]` usd_mint
520          ///   5. `[]` btc_mint
521                ///   6. `[writable]` board_usd_ata
522                ///   7. `[writable]` board_btc_ata
523          ///   8. `[]` swap_program
524          ///   9. `[]` token_program
525#[derive(Clone, Debug)]
526pub struct SwapRoundStakeCpiBuilder<'a, 'b> {
527  instruction: Box<SwapRoundStakeCpiBuilderInstruction<'a, 'b>>,
528}
529
530impl<'a, 'b> SwapRoundStakeCpiBuilder<'a, 'b> {
531  pub fn new(program: &'b solana_account_info::AccountInfo<'a>) -> Self {
532    let instruction = Box::new(SwapRoundStakeCpiBuilderInstruction {
533      __program: program,
534              authority: None,
535              satrush_config: None,
536              board: None,
537              round: None,
538              usd_mint: None,
539              btc_mint: None,
540              board_usd_ata: None,
541              board_btc_ata: None,
542              swap_program: None,
543              token_program: None,
544                                            min_btc_out: None,
545                                swap_data: None,
546                    __remaining_accounts: Vec::new(),
547    });
548    Self { instruction }
549  }
550      /// The round authority keeper that built the off-chain route.
551#[inline(always)]
552    pub fn authority(&mut self, authority: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
553                        self.instruction.authority = Some(authority);
554                    self
555    }
556      #[inline(always)]
557    pub fn satrush_config(&mut self, satrush_config: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
558                        self.instruction.satrush_config = Some(satrush_config);
559                    self
560    }
561      /// PDA that owns the token pools and signs the swap CPI.
562#[inline(always)]
563    pub fn board(&mut self, board: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
564                        self.instruction.board = Some(board);
565                    self
566    }
567      /// The revealed round whose stake is being swapped.
568#[inline(always)]
569    pub fn round(&mut self, round: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
570                        self.instruction.round = Some(round);
571                    self
572    }
573      #[inline(always)]
574    pub fn usd_mint(&mut self, usd_mint: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
575                        self.instruction.usd_mint = Some(usd_mint);
576                    self
577    }
578      #[inline(always)]
579    pub fn btc_mint(&mut self, btc_mint: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
580                        self.instruction.btc_mint = Some(btc_mint);
581                    self
582    }
583      /// Board's USD deposit pool — the swap source.
584#[inline(always)]
585    pub fn board_usd_ata(&mut self, board_usd_ata: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
586                        self.instruction.board_usd_ata = Some(board_usd_ata);
587                    self
588    }
589      /// Board's BTC reserves — the swap destination.
590#[inline(always)]
591    pub fn board_btc_ata(&mut self, board_btc_ata: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
592                        self.instruction.board_btc_ata = Some(board_btc_ata);
593                    self
594    }
595      /// hardcoded `SWAP_PROGRAM` (mock under the `devnet` feature).
596#[inline(always)]
597    pub fn swap_program(&mut self, swap_program: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
598                        self.instruction.swap_program = Some(swap_program);
599                    self
600    }
601      #[inline(always)]
602    pub fn token_program(&mut self, token_program: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
603                        self.instruction.token_program = Some(token_program);
604                    self
605    }
606                    #[inline(always)]
607      pub fn min_btc_out(&mut self, min_btc_out: u64) -> &mut Self {
608        self.instruction.min_btc_out = Some(min_btc_out);
609        self
610      }
611                #[inline(always)]
612      pub fn swap_data(&mut self, swap_data: Vec<u8>) -> &mut Self {
613        self.instruction.swap_data = Some(swap_data);
614        self
615      }
616        /// Add an additional account to the instruction.
617  #[inline(always)]
618  pub fn add_remaining_account(&mut self, account: &'b solana_account_info::AccountInfo<'a>, is_writable: bool, is_signer: bool) -> &mut Self {
619    self.instruction.__remaining_accounts.push((account, is_writable, is_signer));
620    self
621  }
622  /// Add additional accounts to the instruction.
623  ///
624  /// Each account is represented by a tuple of the `AccountInfo`, a `bool` indicating whether the account is writable or not,
625  /// and a `bool` indicating whether the account is a signer or not.
626  #[inline(always)]
627  pub fn add_remaining_accounts(&mut self, accounts: &[(&'b solana_account_info::AccountInfo<'a>, bool, bool)]) -> &mut Self {
628    self.instruction.__remaining_accounts.extend_from_slice(accounts);
629    self
630  }
631  #[inline(always)]
632  pub fn invoke(&self) -> solana_program_error::ProgramResult {
633    self.invoke_signed(&[])
634  }
635  #[allow(clippy::clone_on_copy)]
636  #[allow(clippy::vec_init_then_push)]
637  pub fn invoke_signed(&self, signers_seeds: &[&[&[u8]]]) -> solana_program_error::ProgramResult {
638          let args = SwapRoundStakeInstructionArgs {
639                                                              min_btc_out: self.instruction.min_btc_out.clone().expect("min_btc_out is not set"),
640                                                                  swap_data: self.instruction.swap_data.clone().expect("swap_data is not set"),
641                                    };
642        let instruction = SwapRoundStakeCpi {
643        __program: self.instruction.__program,
644                  
645          authority: self.instruction.authority.expect("authority is not set"),
646                  
647          satrush_config: self.instruction.satrush_config.expect("satrush_config is not set"),
648                  
649          board: self.instruction.board.expect("board is not set"),
650                  
651          round: self.instruction.round.expect("round is not set"),
652                  
653          usd_mint: self.instruction.usd_mint.expect("usd_mint is not set"),
654                  
655          btc_mint: self.instruction.btc_mint.expect("btc_mint is not set"),
656                  
657          board_usd_ata: self.instruction.board_usd_ata.expect("board_usd_ata is not set"),
658                  
659          board_btc_ata: self.instruction.board_btc_ata.expect("board_btc_ata is not set"),
660                  
661          swap_program: self.instruction.swap_program.expect("swap_program is not set"),
662                  
663          token_program: self.instruction.token_program.expect("token_program is not set"),
664                          __args: args,
665            };
666    instruction.invoke_signed_with_remaining_accounts(signers_seeds, &self.instruction.__remaining_accounts)
667  }
668}
669
670#[derive(Clone, Debug)]
671struct SwapRoundStakeCpiBuilderInstruction<'a, 'b> {
672  __program: &'b solana_account_info::AccountInfo<'a>,
673            authority: Option<&'b solana_account_info::AccountInfo<'a>>,
674                satrush_config: Option<&'b solana_account_info::AccountInfo<'a>>,
675                board: Option<&'b solana_account_info::AccountInfo<'a>>,
676                round: Option<&'b solana_account_info::AccountInfo<'a>>,
677                usd_mint: Option<&'b solana_account_info::AccountInfo<'a>>,
678                btc_mint: Option<&'b solana_account_info::AccountInfo<'a>>,
679                board_usd_ata: Option<&'b solana_account_info::AccountInfo<'a>>,
680                board_btc_ata: Option<&'b solana_account_info::AccountInfo<'a>>,
681                swap_program: Option<&'b solana_account_info::AccountInfo<'a>>,
682                token_program: Option<&'b solana_account_info::AccountInfo<'a>>,
683                        min_btc_out: Option<u64>,
684                swap_data: Option<Vec<u8>>,
685        /// Additional instruction accounts `(AccountInfo, is_writable, is_signer)`.
686  __remaining_accounts: Vec<(&'b solana_account_info::AccountInfo<'a>, bool, bool)>,
687}
688