Skip to main content

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