Skip to main content

satrush_client/generated/instructions/
claim.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 CLAIM_DISCRIMINATOR: [u8; 8] = [62, 198, 214, 193, 213, 159, 108, 210];
12
13/// Accounts.
14#[derive(Debug)]
15pub struct Claim {
16      
17              
18          pub authority: solana_address::Address,
19          
20              
21          pub satrush_config: solana_address::Address,
22                /// Round the deployment belongs to. Must be fully settled.
23
24    
25              
26          pub round: solana_address::Address,
27                /// PDA that owns `board_btc_ata`; signs the deposit transfer into the vault.
28
29    
30              
31          pub board: solana_address::Address,
32                /// The caller's settled deployment being claimed. Closed on success so it can
33/// never be claimed twice; rent is returned to the owner.
34
35    
36              
37          pub public_deployment: solana_address::Address,
38                /// Miner profile for `authority`. Created lazily on the first claim and
39/// loaded on subsequent ones.
40
41    
42              
43          pub miner: solana_address::Address,
44                /// The Sats Vault the winner's BTC is deposited into for shares.
45
46    
47              
48          pub sats_vault: solana_address::Address,
49          
50              
51          pub btc_mint: solana_address::Address,
52                /// USD mint — read only to size hashrate points by the stake's whole-USD unit.
53
54    
55              
56          pub usd_mint: solana_address::Address,
57                /// Board's BTC reserves — the round's post-swap BTC, source of the deposit.
58
59    
60              
61          pub board_btc_ata: solana_address::Address,
62                /// Vault's BTC reserves — the deposit destination.
63
64    
65              
66          pub sats_vault_btc_ata: solana_address::Address,
67          
68              
69          pub token_program: solana_address::Address,
70          
71              
72          pub associated_token_program: solana_address::Address,
73          
74              
75          pub system_program: solana_address::Address,
76      }
77
78impl Claim {
79  pub fn instruction(&self) -> solana_instruction::Instruction {
80    self.instruction_with_remaining_accounts(&[])
81  }
82  #[allow(clippy::arithmetic_side_effects)]
83  #[allow(clippy::vec_init_then_push)]
84  pub fn instruction_with_remaining_accounts(&self, remaining_accounts: &[solana_instruction::AccountMeta]) -> solana_instruction::Instruction {
85    let mut accounts = Vec::with_capacity(14+ remaining_accounts.len());
86                            accounts.push(solana_instruction::AccountMeta::new(
87            self.authority,
88            true
89          ));
90                                          accounts.push(solana_instruction::AccountMeta::new_readonly(
91            self.satrush_config,
92            false
93          ));
94                                          accounts.push(solana_instruction::AccountMeta::new(
95            self.round,
96            false
97          ));
98                                          accounts.push(solana_instruction::AccountMeta::new_readonly(
99            self.board,
100            false
101          ));
102                                          accounts.push(solana_instruction::AccountMeta::new(
103            self.public_deployment,
104            false
105          ));
106                                          accounts.push(solana_instruction::AccountMeta::new(
107            self.miner,
108            false
109          ));
110                                          accounts.push(solana_instruction::AccountMeta::new(
111            self.sats_vault,
112            false
113          ));
114                                          accounts.push(solana_instruction::AccountMeta::new_readonly(
115            self.btc_mint,
116            false
117          ));
118                                          accounts.push(solana_instruction::AccountMeta::new_readonly(
119            self.usd_mint,
120            false
121          ));
122                                          accounts.push(solana_instruction::AccountMeta::new(
123            self.board_btc_ata,
124            false
125          ));
126                                          accounts.push(solana_instruction::AccountMeta::new(
127            self.sats_vault_btc_ata,
128            false
129          ));
130                                          accounts.push(solana_instruction::AccountMeta::new_readonly(
131            self.token_program,
132            false
133          ));
134                                          accounts.push(solana_instruction::AccountMeta::new_readonly(
135            self.associated_token_program,
136            false
137          ));
138                                          accounts.push(solana_instruction::AccountMeta::new_readonly(
139            self.system_program,
140            false
141          ));
142                      accounts.extend_from_slice(remaining_accounts);
143    let data = ClaimInstructionData::new().try_to_vec().unwrap();
144    
145    solana_instruction::Instruction {
146      program_id: crate::SATRUSH_ID,
147      accounts,
148      data,
149    }
150  }
151}
152
153#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
154 pub struct ClaimInstructionData {
155            discriminator: [u8; 8],
156      }
157
158impl ClaimInstructionData {
159  pub fn new() -> Self {
160    Self {
161                        discriminator: [62, 198, 214, 193, 213, 159, 108, 210],
162                  }
163  }
164
165    pub(crate) fn try_to_vec(&self) -> Result<Vec<u8>, std::io::Error> {
166    borsh::to_vec(self)
167  }
168  }
169
170impl Default for ClaimInstructionData {
171  fn default() -> Self {
172    Self::new()
173  }
174}
175
176
177
178/// Instruction builder for `Claim`.
179///
180/// ### Accounts:
181///
182                      ///   0. `[writable, signer]` authority
183          ///   1. `[]` satrush_config
184                ///   2. `[writable]` round
185          ///   3. `[]` board
186                ///   4. `[writable]` public_deployment
187                ///   5. `[writable]` miner
188                ///   6. `[writable]` sats_vault
189          ///   7. `[]` btc_mint
190          ///   8. `[]` usd_mint
191                ///   9. `[writable]` board_btc_ata
192                ///   10. `[writable]` sats_vault_btc_ata
193                ///   11. `[optional]` token_program (default to `TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA`)
194                ///   12. `[optional]` associated_token_program (default to `ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL`)
195                ///   13. `[optional]` system_program (default to `11111111111111111111111111111111`)
196#[derive(Clone, Debug, Default)]
197pub struct ClaimBuilder {
198            authority: Option<solana_address::Address>,
199                satrush_config: Option<solana_address::Address>,
200                round: Option<solana_address::Address>,
201                board: Option<solana_address::Address>,
202                public_deployment: Option<solana_address::Address>,
203                miner: Option<solana_address::Address>,
204                sats_vault: Option<solana_address::Address>,
205                btc_mint: Option<solana_address::Address>,
206                usd_mint: Option<solana_address::Address>,
207                board_btc_ata: Option<solana_address::Address>,
208                sats_vault_btc_ata: Option<solana_address::Address>,
209                token_program: Option<solana_address::Address>,
210                associated_token_program: Option<solana_address::Address>,
211                system_program: Option<solana_address::Address>,
212                __remaining_accounts: Vec<solana_instruction::AccountMeta>,
213}
214
215impl ClaimBuilder {
216  pub fn new() -> Self {
217    Self::default()
218  }
219            #[inline(always)]
220    pub fn authority(&mut self, authority: solana_address::Address) -> &mut Self {
221                        self.authority = Some(authority);
222                    self
223    }
224            #[inline(always)]
225    pub fn satrush_config(&mut self, satrush_config: solana_address::Address) -> &mut Self {
226                        self.satrush_config = Some(satrush_config);
227                    self
228    }
229            /// Round the deployment belongs to. Must be fully settled.
230#[inline(always)]
231    pub fn round(&mut self, round: solana_address::Address) -> &mut Self {
232                        self.round = Some(round);
233                    self
234    }
235            /// PDA that owns `board_btc_ata`; signs the deposit transfer into the vault.
236#[inline(always)]
237    pub fn board(&mut self, board: solana_address::Address) -> &mut Self {
238                        self.board = Some(board);
239                    self
240    }
241            /// The caller's settled deployment being claimed. Closed on success so it can
242/// never be claimed twice; rent is returned to the owner.
243#[inline(always)]
244    pub fn public_deployment(&mut self, public_deployment: solana_address::Address) -> &mut Self {
245                        self.public_deployment = Some(public_deployment);
246                    self
247    }
248            /// Miner profile for `authority`. Created lazily on the first claim and
249/// loaded on subsequent ones.
250#[inline(always)]
251    pub fn miner(&mut self, miner: solana_address::Address) -> &mut Self {
252                        self.miner = Some(miner);
253                    self
254    }
255            /// The Sats Vault the winner's BTC is deposited into for shares.
256#[inline(always)]
257    pub fn sats_vault(&mut self, sats_vault: solana_address::Address) -> &mut Self {
258                        self.sats_vault = Some(sats_vault);
259                    self
260    }
261            #[inline(always)]
262    pub fn btc_mint(&mut self, btc_mint: solana_address::Address) -> &mut Self {
263                        self.btc_mint = Some(btc_mint);
264                    self
265    }
266            /// USD mint — read only to size hashrate points by the stake's whole-USD unit.
267#[inline(always)]
268    pub fn usd_mint(&mut self, usd_mint: solana_address::Address) -> &mut Self {
269                        self.usd_mint = Some(usd_mint);
270                    self
271    }
272            /// Board's BTC reserves — the round's post-swap BTC, source of the deposit.
273#[inline(always)]
274    pub fn board_btc_ata(&mut self, board_btc_ata: solana_address::Address) -> &mut Self {
275                        self.board_btc_ata = Some(board_btc_ata);
276                    self
277    }
278            /// Vault's BTC reserves — the deposit destination.
279#[inline(always)]
280    pub fn sats_vault_btc_ata(&mut self, sats_vault_btc_ata: solana_address::Address) -> &mut Self {
281                        self.sats_vault_btc_ata = Some(sats_vault_btc_ata);
282                    self
283    }
284            /// `[optional account, default to 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA']`
285#[inline(always)]
286    pub fn token_program(&mut self, token_program: solana_address::Address) -> &mut Self {
287                        self.token_program = Some(token_program);
288                    self
289    }
290            /// `[optional account, default to 'ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL']`
291#[inline(always)]
292    pub fn associated_token_program(&mut self, associated_token_program: solana_address::Address) -> &mut Self {
293                        self.associated_token_program = Some(associated_token_program);
294                    self
295    }
296            /// `[optional account, default to '11111111111111111111111111111111']`
297#[inline(always)]
298    pub fn system_program(&mut self, system_program: solana_address::Address) -> &mut Self {
299                        self.system_program = Some(system_program);
300                    self
301    }
302            /// Add an additional account to the instruction.
303  #[inline(always)]
304  pub fn add_remaining_account(&mut self, account: solana_instruction::AccountMeta) -> &mut Self {
305    self.__remaining_accounts.push(account);
306    self
307  }
308  /// Add additional accounts to the instruction.
309  #[inline(always)]
310  pub fn add_remaining_accounts(&mut self, accounts: &[solana_instruction::AccountMeta]) -> &mut Self {
311    self.__remaining_accounts.extend_from_slice(accounts);
312    self
313  }
314  #[allow(clippy::clone_on_copy)]
315  pub fn instruction(&self) -> solana_instruction::Instruction {
316    let accounts = Claim {
317                              authority: self.authority.expect("authority is not set"),
318                                        satrush_config: self.satrush_config.expect("satrush_config is not set"),
319                                        round: self.round.expect("round is not set"),
320                                        board: self.board.expect("board is not set"),
321                                        public_deployment: self.public_deployment.expect("public_deployment is not set"),
322                                        miner: self.miner.expect("miner is not set"),
323                                        sats_vault: self.sats_vault.expect("sats_vault is not set"),
324                                        btc_mint: self.btc_mint.expect("btc_mint is not set"),
325                                        usd_mint: self.usd_mint.expect("usd_mint is not set"),
326                                        board_btc_ata: self.board_btc_ata.expect("board_btc_ata is not set"),
327                                        sats_vault_btc_ata: self.sats_vault_btc_ata.expect("sats_vault_btc_ata is not set"),
328                                        token_program: self.token_program.unwrap_or(solana_address::address!("TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA")),
329                                        associated_token_program: self.associated_token_program.unwrap_or(solana_address::address!("ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL")),
330                                        system_program: self.system_program.unwrap_or(solana_address::address!("11111111111111111111111111111111")),
331                      };
332    
333    accounts.instruction_with_remaining_accounts(&self.__remaining_accounts)
334  }
335}
336
337  /// `claim` CPI accounts.
338  pub struct ClaimCpiAccounts<'a, 'b> {
339          
340                    
341              pub authority: &'b solana_account_info::AccountInfo<'a>,
342                
343                    
344              pub satrush_config: &'b solana_account_info::AccountInfo<'a>,
345                        /// Round the deployment belongs to. Must be fully settled.
346
347      
348                    
349              pub round: &'b solana_account_info::AccountInfo<'a>,
350                        /// PDA that owns `board_btc_ata`; signs the deposit transfer into the vault.
351
352      
353                    
354              pub board: &'b solana_account_info::AccountInfo<'a>,
355                        /// The caller's settled deployment being claimed. Closed on success so it can
356/// never be claimed twice; rent is returned to the owner.
357
358      
359                    
360              pub public_deployment: &'b solana_account_info::AccountInfo<'a>,
361                        /// Miner profile for `authority`. Created lazily on the first claim and
362/// loaded on subsequent ones.
363
364      
365                    
366              pub miner: &'b solana_account_info::AccountInfo<'a>,
367                        /// The Sats Vault the winner's BTC is deposited into for shares.
368
369      
370                    
371              pub sats_vault: &'b solana_account_info::AccountInfo<'a>,
372                
373                    
374              pub btc_mint: &'b solana_account_info::AccountInfo<'a>,
375                        /// USD mint — read only to size hashrate points by the stake's whole-USD unit.
376
377      
378                    
379              pub usd_mint: &'b solana_account_info::AccountInfo<'a>,
380                        /// Board's BTC reserves — the round's post-swap BTC, source of the deposit.
381
382      
383                    
384              pub board_btc_ata: &'b solana_account_info::AccountInfo<'a>,
385                        /// Vault's BTC reserves — the deposit destination.
386
387      
388                    
389              pub sats_vault_btc_ata: &'b solana_account_info::AccountInfo<'a>,
390                
391                    
392              pub token_program: &'b solana_account_info::AccountInfo<'a>,
393                
394                    
395              pub associated_token_program: &'b solana_account_info::AccountInfo<'a>,
396                
397                    
398              pub system_program: &'b solana_account_info::AccountInfo<'a>,
399            }
400
401/// `claim` CPI instruction.
402pub struct ClaimCpi<'a, 'b> {
403  /// The program to invoke.
404  pub __program: &'b solana_account_info::AccountInfo<'a>,
405      
406              
407          pub authority: &'b solana_account_info::AccountInfo<'a>,
408          
409              
410          pub satrush_config: &'b solana_account_info::AccountInfo<'a>,
411                /// Round the deployment belongs to. Must be fully settled.
412
413    
414              
415          pub round: &'b solana_account_info::AccountInfo<'a>,
416                /// PDA that owns `board_btc_ata`; signs the deposit transfer into the vault.
417
418    
419              
420          pub board: &'b solana_account_info::AccountInfo<'a>,
421                /// The caller's settled deployment being claimed. Closed on success so it can
422/// never be claimed twice; rent is returned to the owner.
423
424    
425              
426          pub public_deployment: &'b solana_account_info::AccountInfo<'a>,
427                /// Miner profile for `authority`. Created lazily on the first claim and
428/// loaded on subsequent ones.
429
430    
431              
432          pub miner: &'b solana_account_info::AccountInfo<'a>,
433                /// The Sats Vault the winner's BTC is deposited into for shares.
434
435    
436              
437          pub sats_vault: &'b solana_account_info::AccountInfo<'a>,
438          
439              
440          pub btc_mint: &'b solana_account_info::AccountInfo<'a>,
441                /// USD mint — read only to size hashrate points by the stake's whole-USD unit.
442
443    
444              
445          pub usd_mint: &'b solana_account_info::AccountInfo<'a>,
446                /// Board's BTC reserves — the round's post-swap BTC, source of the deposit.
447
448    
449              
450          pub board_btc_ata: &'b solana_account_info::AccountInfo<'a>,
451                /// Vault's BTC reserves — the deposit destination.
452
453    
454              
455          pub sats_vault_btc_ata: &'b solana_account_info::AccountInfo<'a>,
456          
457              
458          pub token_program: &'b solana_account_info::AccountInfo<'a>,
459          
460              
461          pub associated_token_program: &'b solana_account_info::AccountInfo<'a>,
462          
463              
464          pub system_program: &'b solana_account_info::AccountInfo<'a>,
465        }
466
467impl<'a, 'b> ClaimCpi<'a, 'b> {
468  pub fn new(
469    program: &'b solana_account_info::AccountInfo<'a>,
470          accounts: ClaimCpiAccounts<'a, 'b>,
471          ) -> Self {
472    Self {
473      __program: program,
474              authority: accounts.authority,
475              satrush_config: accounts.satrush_config,
476              round: accounts.round,
477              board: accounts.board,
478              public_deployment: accounts.public_deployment,
479              miner: accounts.miner,
480              sats_vault: accounts.sats_vault,
481              btc_mint: accounts.btc_mint,
482              usd_mint: accounts.usd_mint,
483              board_btc_ata: accounts.board_btc_ata,
484              sats_vault_btc_ata: accounts.sats_vault_btc_ata,
485              token_program: accounts.token_program,
486              associated_token_program: accounts.associated_token_program,
487              system_program: accounts.system_program,
488                }
489  }
490  #[inline(always)]
491  pub fn invoke(&self) -> solana_program_error::ProgramResult {
492    self.invoke_signed_with_remaining_accounts(&[], &[])
493  }
494  #[inline(always)]
495  pub fn invoke_with_remaining_accounts(&self, remaining_accounts: &[(&'b solana_account_info::AccountInfo<'a>, bool, bool)]) -> solana_program_error::ProgramResult {
496    self.invoke_signed_with_remaining_accounts(&[], remaining_accounts)
497  }
498  #[inline(always)]
499  pub fn invoke_signed(&self, signers_seeds: &[&[&[u8]]]) -> solana_program_error::ProgramResult {
500    self.invoke_signed_with_remaining_accounts(signers_seeds, &[])
501  }
502  #[allow(clippy::arithmetic_side_effects)]
503  #[allow(clippy::clone_on_copy)]
504  #[allow(clippy::vec_init_then_push)]
505  pub fn invoke_signed_with_remaining_accounts(
506    &self,
507    signers_seeds: &[&[&[u8]]],
508    remaining_accounts: &[(&'b solana_account_info::AccountInfo<'a>, bool, bool)]
509  ) -> solana_program_error::ProgramResult {
510    let mut accounts = Vec::with_capacity(14+ remaining_accounts.len());
511                            accounts.push(solana_instruction::AccountMeta::new(
512            *self.authority.key,
513            true
514          ));
515                                          accounts.push(solana_instruction::AccountMeta::new_readonly(
516            *self.satrush_config.key,
517            false
518          ));
519                                          accounts.push(solana_instruction::AccountMeta::new(
520            *self.round.key,
521            false
522          ));
523                                          accounts.push(solana_instruction::AccountMeta::new_readonly(
524            *self.board.key,
525            false
526          ));
527                                          accounts.push(solana_instruction::AccountMeta::new(
528            *self.public_deployment.key,
529            false
530          ));
531                                          accounts.push(solana_instruction::AccountMeta::new(
532            *self.miner.key,
533            false
534          ));
535                                          accounts.push(solana_instruction::AccountMeta::new(
536            *self.sats_vault.key,
537            false
538          ));
539                                          accounts.push(solana_instruction::AccountMeta::new_readonly(
540            *self.btc_mint.key,
541            false
542          ));
543                                          accounts.push(solana_instruction::AccountMeta::new_readonly(
544            *self.usd_mint.key,
545            false
546          ));
547                                          accounts.push(solana_instruction::AccountMeta::new(
548            *self.board_btc_ata.key,
549            false
550          ));
551                                          accounts.push(solana_instruction::AccountMeta::new(
552            *self.sats_vault_btc_ata.key,
553            false
554          ));
555                                          accounts.push(solana_instruction::AccountMeta::new_readonly(
556            *self.token_program.key,
557            false
558          ));
559                                          accounts.push(solana_instruction::AccountMeta::new_readonly(
560            *self.associated_token_program.key,
561            false
562          ));
563                                          accounts.push(solana_instruction::AccountMeta::new_readonly(
564            *self.system_program.key,
565            false
566          ));
567                      remaining_accounts.iter().for_each(|remaining_account| {
568      accounts.push(solana_instruction::AccountMeta {
569          pubkey: *remaining_account.0.key,
570          is_signer: remaining_account.1,
571          is_writable: remaining_account.2,
572      })
573    });
574    let data = ClaimInstructionData::new().try_to_vec().unwrap();
575    
576    let instruction = solana_instruction::Instruction {
577      program_id: crate::SATRUSH_ID,
578      accounts,
579      data,
580    };
581    let mut account_infos = Vec::with_capacity(15 + remaining_accounts.len());
582    account_infos.push(self.__program.clone());
583                  account_infos.push(self.authority.clone());
584                        account_infos.push(self.satrush_config.clone());
585                        account_infos.push(self.round.clone());
586                        account_infos.push(self.board.clone());
587                        account_infos.push(self.public_deployment.clone());
588                        account_infos.push(self.miner.clone());
589                        account_infos.push(self.sats_vault.clone());
590                        account_infos.push(self.btc_mint.clone());
591                        account_infos.push(self.usd_mint.clone());
592                        account_infos.push(self.board_btc_ata.clone());
593                        account_infos.push(self.sats_vault_btc_ata.clone());
594                        account_infos.push(self.token_program.clone());
595                        account_infos.push(self.associated_token_program.clone());
596                        account_infos.push(self.system_program.clone());
597              remaining_accounts.iter().for_each(|remaining_account| account_infos.push(remaining_account.0.clone()));
598
599    if signers_seeds.is_empty() {
600      solana_cpi::invoke(&instruction, &account_infos)
601    } else {
602      solana_cpi::invoke_signed(&instruction, &account_infos, signers_seeds)
603    }
604  }
605}
606
607/// Instruction builder for `Claim` via CPI.
608///
609/// ### Accounts:
610///
611                      ///   0. `[writable, signer]` authority
612          ///   1. `[]` satrush_config
613                ///   2. `[writable]` round
614          ///   3. `[]` board
615                ///   4. `[writable]` public_deployment
616                ///   5. `[writable]` miner
617                ///   6. `[writable]` sats_vault
618          ///   7. `[]` btc_mint
619          ///   8. `[]` usd_mint
620                ///   9. `[writable]` board_btc_ata
621                ///   10. `[writable]` sats_vault_btc_ata
622          ///   11. `[]` token_program
623          ///   12. `[]` associated_token_program
624          ///   13. `[]` system_program
625#[derive(Clone, Debug)]
626pub struct ClaimCpiBuilder<'a, 'b> {
627  instruction: Box<ClaimCpiBuilderInstruction<'a, 'b>>,
628}
629
630impl<'a, 'b> ClaimCpiBuilder<'a, 'b> {
631  pub fn new(program: &'b solana_account_info::AccountInfo<'a>) -> Self {
632    let instruction = Box::new(ClaimCpiBuilderInstruction {
633      __program: program,
634              authority: None,
635              satrush_config: None,
636              round: None,
637              board: None,
638              public_deployment: None,
639              miner: None,
640              sats_vault: None,
641              btc_mint: None,
642              usd_mint: None,
643              board_btc_ata: None,
644              sats_vault_btc_ata: None,
645              token_program: None,
646              associated_token_program: None,
647              system_program: None,
648                                __remaining_accounts: Vec::new(),
649    });
650    Self { instruction }
651  }
652      #[inline(always)]
653    pub fn authority(&mut self, authority: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
654                        self.instruction.authority = Some(authority);
655                    self
656    }
657      #[inline(always)]
658    pub fn satrush_config(&mut self, satrush_config: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
659                        self.instruction.satrush_config = Some(satrush_config);
660                    self
661    }
662      /// Round the deployment belongs to. Must be fully settled.
663#[inline(always)]
664    pub fn round(&mut self, round: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
665                        self.instruction.round = Some(round);
666                    self
667    }
668      /// PDA that owns `board_btc_ata`; signs the deposit transfer into the vault.
669#[inline(always)]
670    pub fn board(&mut self, board: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
671                        self.instruction.board = Some(board);
672                    self
673    }
674      /// The caller's settled deployment being claimed. Closed on success so it can
675/// never be claimed twice; rent is returned to the owner.
676#[inline(always)]
677    pub fn public_deployment(&mut self, public_deployment: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
678                        self.instruction.public_deployment = Some(public_deployment);
679                    self
680    }
681      /// Miner profile for `authority`. Created lazily on the first claim and
682/// loaded on subsequent ones.
683#[inline(always)]
684    pub fn miner(&mut self, miner: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
685                        self.instruction.miner = Some(miner);
686                    self
687    }
688      /// The Sats Vault the winner's BTC is deposited into for shares.
689#[inline(always)]
690    pub fn sats_vault(&mut self, sats_vault: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
691                        self.instruction.sats_vault = Some(sats_vault);
692                    self
693    }
694      #[inline(always)]
695    pub fn btc_mint(&mut self, btc_mint: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
696                        self.instruction.btc_mint = Some(btc_mint);
697                    self
698    }
699      /// USD mint — read only to size hashrate points by the stake's whole-USD unit.
700#[inline(always)]
701    pub fn usd_mint(&mut self, usd_mint: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
702                        self.instruction.usd_mint = Some(usd_mint);
703                    self
704    }
705      /// Board's BTC reserves — the round's post-swap BTC, source of the deposit.
706#[inline(always)]
707    pub fn board_btc_ata(&mut self, board_btc_ata: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
708                        self.instruction.board_btc_ata = Some(board_btc_ata);
709                    self
710    }
711      /// Vault's BTC reserves — the deposit destination.
712#[inline(always)]
713    pub fn sats_vault_btc_ata(&mut self, sats_vault_btc_ata: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
714                        self.instruction.sats_vault_btc_ata = Some(sats_vault_btc_ata);
715                    self
716    }
717      #[inline(always)]
718    pub fn token_program(&mut self, token_program: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
719                        self.instruction.token_program = Some(token_program);
720                    self
721    }
722      #[inline(always)]
723    pub fn associated_token_program(&mut self, associated_token_program: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
724                        self.instruction.associated_token_program = Some(associated_token_program);
725                    self
726    }
727      #[inline(always)]
728    pub fn system_program(&mut self, system_program: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
729                        self.instruction.system_program = Some(system_program);
730                    self
731    }
732            /// Add an additional account to the instruction.
733  #[inline(always)]
734  pub fn add_remaining_account(&mut self, account: &'b solana_account_info::AccountInfo<'a>, is_writable: bool, is_signer: bool) -> &mut Self {
735    self.instruction.__remaining_accounts.push((account, is_writable, is_signer));
736    self
737  }
738  /// Add additional accounts to the instruction.
739  ///
740  /// Each account is represented by a tuple of the `AccountInfo`, a `bool` indicating whether the account is writable or not,
741  /// and a `bool` indicating whether the account is a signer or not.
742  #[inline(always)]
743  pub fn add_remaining_accounts(&mut self, accounts: &[(&'b solana_account_info::AccountInfo<'a>, bool, bool)]) -> &mut Self {
744    self.instruction.__remaining_accounts.extend_from_slice(accounts);
745    self
746  }
747  #[inline(always)]
748  pub fn invoke(&self) -> solana_program_error::ProgramResult {
749    self.invoke_signed(&[])
750  }
751  #[allow(clippy::clone_on_copy)]
752  #[allow(clippy::vec_init_then_push)]
753  pub fn invoke_signed(&self, signers_seeds: &[&[&[u8]]]) -> solana_program_error::ProgramResult {
754        let instruction = ClaimCpi {
755        __program: self.instruction.__program,
756                  
757          authority: self.instruction.authority.expect("authority is not set"),
758                  
759          satrush_config: self.instruction.satrush_config.expect("satrush_config is not set"),
760                  
761          round: self.instruction.round.expect("round is not set"),
762                  
763          board: self.instruction.board.expect("board is not set"),
764                  
765          public_deployment: self.instruction.public_deployment.expect("public_deployment is not set"),
766                  
767          miner: self.instruction.miner.expect("miner is not set"),
768                  
769          sats_vault: self.instruction.sats_vault.expect("sats_vault is not set"),
770                  
771          btc_mint: self.instruction.btc_mint.expect("btc_mint is not set"),
772                  
773          usd_mint: self.instruction.usd_mint.expect("usd_mint is not set"),
774                  
775          board_btc_ata: self.instruction.board_btc_ata.expect("board_btc_ata is not set"),
776                  
777          sats_vault_btc_ata: self.instruction.sats_vault_btc_ata.expect("sats_vault_btc_ata is not set"),
778                  
779          token_program: self.instruction.token_program.expect("token_program is not set"),
780                  
781          associated_token_program: self.instruction.associated_token_program.expect("associated_token_program is not set"),
782                  
783          system_program: self.instruction.system_program.expect("system_program is not set"),
784                    };
785    instruction.invoke_signed_with_remaining_accounts(signers_seeds, &self.instruction.__remaining_accounts)
786  }
787}
788
789#[derive(Clone, Debug)]
790struct ClaimCpiBuilderInstruction<'a, 'b> {
791  __program: &'b solana_account_info::AccountInfo<'a>,
792            authority: Option<&'b solana_account_info::AccountInfo<'a>>,
793                satrush_config: Option<&'b solana_account_info::AccountInfo<'a>>,
794                round: Option<&'b solana_account_info::AccountInfo<'a>>,
795                board: Option<&'b solana_account_info::AccountInfo<'a>>,
796                public_deployment: Option<&'b solana_account_info::AccountInfo<'a>>,
797                miner: Option<&'b solana_account_info::AccountInfo<'a>>,
798                sats_vault: Option<&'b solana_account_info::AccountInfo<'a>>,
799                btc_mint: Option<&'b solana_account_info::AccountInfo<'a>>,
800                usd_mint: Option<&'b solana_account_info::AccountInfo<'a>>,
801                board_btc_ata: Option<&'b solana_account_info::AccountInfo<'a>>,
802                sats_vault_btc_ata: Option<&'b solana_account_info::AccountInfo<'a>>,
803                token_program: Option<&'b solana_account_info::AccountInfo<'a>>,
804                associated_token_program: Option<&'b solana_account_info::AccountInfo<'a>>,
805                system_program: Option<&'b solana_account_info::AccountInfo<'a>>,
806                /// Additional instruction accounts `(AccountInfo, is_writable, is_signer)`.
807  __remaining_accounts: Vec<(&'b solana_account_info::AccountInfo<'a>, bool, bool)>,
808}
809