1use crate::generated::types::AuthorizationData;
9use crate::generated::types::Data;
10use borsh::BorshDeserialize;
11use borsh::BorshSerialize;
12
13pub struct UpdateAsDataDelegateV2 {
15 pub authority: solana_program::pubkey::Pubkey,
17 pub delegate_record: Option<solana_program::pubkey::Pubkey>,
19 pub token: Option<solana_program::pubkey::Pubkey>,
21 pub mint: solana_program::pubkey::Pubkey,
23 pub metadata: solana_program::pubkey::Pubkey,
25 pub edition: Option<solana_program::pubkey::Pubkey>,
27 pub payer: solana_program::pubkey::Pubkey,
29 pub system_program: solana_program::pubkey::Pubkey,
31 pub sysvar_instructions: solana_program::pubkey::Pubkey,
33 pub authorization_rules_program: Option<solana_program::pubkey::Pubkey>,
35 pub authorization_rules: Option<solana_program::pubkey::Pubkey>,
37}
38
39impl UpdateAsDataDelegateV2 {
40 pub fn instruction(
41 &self,
42 args: UpdateAsDataDelegateV2InstructionArgs,
43 ) -> solana_program::instruction::Instruction {
44 self.instruction_with_remaining_accounts(args, &[])
45 }
46 #[allow(clippy::vec_init_then_push)]
47 pub fn instruction_with_remaining_accounts(
48 &self,
49 args: UpdateAsDataDelegateV2InstructionArgs,
50 remaining_accounts: &[solana_program::instruction::AccountMeta],
51 ) -> solana_program::instruction::Instruction {
52 let mut accounts = Vec::with_capacity(11 + remaining_accounts.len());
53 accounts.push(solana_program::instruction::AccountMeta::new_readonly(
54 self.authority,
55 true,
56 ));
57 if let Some(delegate_record) = self.delegate_record {
58 accounts.push(solana_program::instruction::AccountMeta::new_readonly(
59 delegate_record,
60 false,
61 ));
62 } else {
63 accounts.push(solana_program::instruction::AccountMeta::new_readonly(
64 crate::MPL_TOKEN_METADATA_ID,
65 false,
66 ));
67 }
68 if let Some(token) = self.token {
69 accounts.push(solana_program::instruction::AccountMeta::new_readonly(
70 token, false,
71 ));
72 } else {
73 accounts.push(solana_program::instruction::AccountMeta::new_readonly(
74 crate::MPL_TOKEN_METADATA_ID,
75 false,
76 ));
77 }
78 accounts.push(solana_program::instruction::AccountMeta::new_readonly(
79 self.mint, false,
80 ));
81 accounts.push(solana_program::instruction::AccountMeta::new(
82 self.metadata,
83 false,
84 ));
85 if let Some(edition) = self.edition {
86 accounts.push(solana_program::instruction::AccountMeta::new_readonly(
87 edition, false,
88 ));
89 } else {
90 accounts.push(solana_program::instruction::AccountMeta::new_readonly(
91 crate::MPL_TOKEN_METADATA_ID,
92 false,
93 ));
94 }
95 accounts.push(solana_program::instruction::AccountMeta::new(
96 self.payer, true,
97 ));
98 accounts.push(solana_program::instruction::AccountMeta::new_readonly(
99 self.system_program,
100 false,
101 ));
102 accounts.push(solana_program::instruction::AccountMeta::new_readonly(
103 self.sysvar_instructions,
104 false,
105 ));
106 if let Some(authorization_rules_program) = self.authorization_rules_program {
107 accounts.push(solana_program::instruction::AccountMeta::new_readonly(
108 authorization_rules_program,
109 false,
110 ));
111 } else {
112 accounts.push(solana_program::instruction::AccountMeta::new_readonly(
113 crate::MPL_TOKEN_METADATA_ID,
114 false,
115 ));
116 }
117 if let Some(authorization_rules) = self.authorization_rules {
118 accounts.push(solana_program::instruction::AccountMeta::new_readonly(
119 authorization_rules,
120 false,
121 ));
122 } else {
123 accounts.push(solana_program::instruction::AccountMeta::new_readonly(
124 crate::MPL_TOKEN_METADATA_ID,
125 false,
126 ));
127 }
128 accounts.extend_from_slice(remaining_accounts);
129 let mut data = UpdateAsDataDelegateV2InstructionData::new()
130 .try_to_vec()
131 .unwrap();
132 let mut args = args.try_to_vec().unwrap();
133 data.append(&mut args);
134
135 solana_program::instruction::Instruction {
136 program_id: crate::MPL_TOKEN_METADATA_ID,
137 accounts,
138 data,
139 }
140 }
141}
142
143#[derive(BorshDeserialize, BorshSerialize)]
144struct UpdateAsDataDelegateV2InstructionData {
145 discriminator: u8,
146 update_as_data_delegate_v2_discriminator: u8,
147}
148
149impl UpdateAsDataDelegateV2InstructionData {
150 fn new() -> Self {
151 Self {
152 discriminator: 50,
153 update_as_data_delegate_v2_discriminator: 4,
154 }
155 }
156}
157
158#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
159#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
160pub struct UpdateAsDataDelegateV2InstructionArgs {
161 pub data: Option<Data>,
162 pub authorization_data: Option<AuthorizationData>,
163}
164
165#[derive(Default)]
181pub struct UpdateAsDataDelegateV2Builder {
182 authority: Option<solana_program::pubkey::Pubkey>,
183 delegate_record: Option<solana_program::pubkey::Pubkey>,
184 token: Option<solana_program::pubkey::Pubkey>,
185 mint: Option<solana_program::pubkey::Pubkey>,
186 metadata: Option<solana_program::pubkey::Pubkey>,
187 edition: Option<solana_program::pubkey::Pubkey>,
188 payer: Option<solana_program::pubkey::Pubkey>,
189 system_program: Option<solana_program::pubkey::Pubkey>,
190 sysvar_instructions: Option<solana_program::pubkey::Pubkey>,
191 authorization_rules_program: Option<solana_program::pubkey::Pubkey>,
192 authorization_rules: Option<solana_program::pubkey::Pubkey>,
193 data: Option<Data>,
194 authorization_data: Option<AuthorizationData>,
195 __remaining_accounts: Vec<solana_program::instruction::AccountMeta>,
196}
197
198impl UpdateAsDataDelegateV2Builder {
199 pub fn new() -> Self {
200 Self::default()
201 }
202 #[inline(always)]
204 pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self {
205 self.authority = Some(authority);
206 self
207 }
208 #[inline(always)]
211 pub fn delegate_record(
212 &mut self,
213 delegate_record: Option<solana_program::pubkey::Pubkey>,
214 ) -> &mut Self {
215 self.delegate_record = delegate_record;
216 self
217 }
218 #[inline(always)]
221 pub fn token(&mut self, token: Option<solana_program::pubkey::Pubkey>) -> &mut Self {
222 self.token = token;
223 self
224 }
225 #[inline(always)]
227 pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self {
228 self.mint = Some(mint);
229 self
230 }
231 #[inline(always)]
233 pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self {
234 self.metadata = Some(metadata);
235 self
236 }
237 #[inline(always)]
240 pub fn edition(&mut self, edition: Option<solana_program::pubkey::Pubkey>) -> &mut Self {
241 self.edition = edition;
242 self
243 }
244 #[inline(always)]
246 pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self {
247 self.payer = Some(payer);
248 self
249 }
250 #[inline(always)]
253 pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self {
254 self.system_program = Some(system_program);
255 self
256 }
257 #[inline(always)]
260 pub fn sysvar_instructions(
261 &mut self,
262 sysvar_instructions: solana_program::pubkey::Pubkey,
263 ) -> &mut Self {
264 self.sysvar_instructions = Some(sysvar_instructions);
265 self
266 }
267 #[inline(always)]
270 pub fn authorization_rules_program(
271 &mut self,
272 authorization_rules_program: Option<solana_program::pubkey::Pubkey>,
273 ) -> &mut Self {
274 self.authorization_rules_program = authorization_rules_program;
275 self
276 }
277 #[inline(always)]
280 pub fn authorization_rules(
281 &mut self,
282 authorization_rules: Option<solana_program::pubkey::Pubkey>,
283 ) -> &mut Self {
284 self.authorization_rules = authorization_rules;
285 self
286 }
287 #[inline(always)]
289 pub fn data(&mut self, data: Data) -> &mut Self {
290 self.data = Some(data);
291 self
292 }
293 #[inline(always)]
295 pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self {
296 self.authorization_data = Some(authorization_data);
297 self
298 }
299 #[inline(always)]
301 pub fn add_remaining_account(
302 &mut self,
303 account: solana_program::instruction::AccountMeta,
304 ) -> &mut Self {
305 self.__remaining_accounts.push(account);
306 self
307 }
308 #[inline(always)]
310 pub fn add_remaining_accounts(
311 &mut self,
312 accounts: &[solana_program::instruction::AccountMeta],
313 ) -> &mut Self {
314 self.__remaining_accounts.extend_from_slice(accounts);
315 self
316 }
317 #[allow(clippy::clone_on_copy)]
318 pub fn instruction(&self) -> solana_program::instruction::Instruction {
319 let accounts = UpdateAsDataDelegateV2 {
320 authority: self.authority.expect("authority is not set"),
321 delegate_record: self.delegate_record,
322 token: self.token,
323 mint: self.mint.expect("mint is not set"),
324 metadata: self.metadata.expect("metadata is not set"),
325 edition: self.edition,
326 payer: self.payer.expect("payer is not set"),
327 system_program: self
328 .system_program
329 .unwrap_or(solana_program::pubkey!("11111111111111111111111111111111")),
330 sysvar_instructions: self.sysvar_instructions.unwrap_or(solana_program::pubkey!(
331 "Sysvar1nstructions1111111111111111111111111"
332 )),
333 authorization_rules_program: self.authorization_rules_program,
334 authorization_rules: self.authorization_rules,
335 };
336 let args = UpdateAsDataDelegateV2InstructionArgs {
337 data: self.data.clone(),
338 authorization_data: self.authorization_data.clone(),
339 };
340
341 accounts.instruction_with_remaining_accounts(args, &self.__remaining_accounts)
342 }
343}
344
345pub struct UpdateAsDataDelegateV2CpiAccounts<'a, 'b> {
347 pub authority: &'b solana_program::account_info::AccountInfo<'a>,
349 pub delegate_record: Option<&'b solana_program::account_info::AccountInfo<'a>>,
351 pub token: Option<&'b solana_program::account_info::AccountInfo<'a>>,
353 pub mint: &'b solana_program::account_info::AccountInfo<'a>,
355 pub metadata: &'b solana_program::account_info::AccountInfo<'a>,
357 pub edition: Option<&'b solana_program::account_info::AccountInfo<'a>>,
359 pub payer: &'b solana_program::account_info::AccountInfo<'a>,
361 pub system_program: &'b solana_program::account_info::AccountInfo<'a>,
363 pub sysvar_instructions: &'b solana_program::account_info::AccountInfo<'a>,
365 pub authorization_rules_program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
367 pub authorization_rules: Option<&'b solana_program::account_info::AccountInfo<'a>>,
369}
370
371pub struct UpdateAsDataDelegateV2Cpi<'a, 'b> {
373 pub __program: &'b solana_program::account_info::AccountInfo<'a>,
375 pub authority: &'b solana_program::account_info::AccountInfo<'a>,
377 pub delegate_record: Option<&'b solana_program::account_info::AccountInfo<'a>>,
379 pub token: Option<&'b solana_program::account_info::AccountInfo<'a>>,
381 pub mint: &'b solana_program::account_info::AccountInfo<'a>,
383 pub metadata: &'b solana_program::account_info::AccountInfo<'a>,
385 pub edition: Option<&'b solana_program::account_info::AccountInfo<'a>>,
387 pub payer: &'b solana_program::account_info::AccountInfo<'a>,
389 pub system_program: &'b solana_program::account_info::AccountInfo<'a>,
391 pub sysvar_instructions: &'b solana_program::account_info::AccountInfo<'a>,
393 pub authorization_rules_program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
395 pub authorization_rules: Option<&'b solana_program::account_info::AccountInfo<'a>>,
397 pub __args: UpdateAsDataDelegateV2InstructionArgs,
399}
400
401impl<'a, 'b> UpdateAsDataDelegateV2Cpi<'a, 'b> {
402 pub fn new(
403 program: &'b solana_program::account_info::AccountInfo<'a>,
404 accounts: UpdateAsDataDelegateV2CpiAccounts<'a, 'b>,
405 args: UpdateAsDataDelegateV2InstructionArgs,
406 ) -> Self {
407 Self {
408 __program: program,
409 authority: accounts.authority,
410 delegate_record: accounts.delegate_record,
411 token: accounts.token,
412 mint: accounts.mint,
413 metadata: accounts.metadata,
414 edition: accounts.edition,
415 payer: accounts.payer,
416 system_program: accounts.system_program,
417 sysvar_instructions: accounts.sysvar_instructions,
418 authorization_rules_program: accounts.authorization_rules_program,
419 authorization_rules: accounts.authorization_rules,
420 __args: args,
421 }
422 }
423 #[inline(always)]
424 pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult {
425 self.invoke_signed_with_remaining_accounts(&[], &[])
426 }
427 #[inline(always)]
428 pub fn invoke_with_remaining_accounts(
429 &self,
430 remaining_accounts: &[(
431 &'b solana_program::account_info::AccountInfo<'a>,
432 bool,
433 bool,
434 )],
435 ) -> solana_program::entrypoint::ProgramResult {
436 self.invoke_signed_with_remaining_accounts(&[], remaining_accounts)
437 }
438 #[inline(always)]
439 pub fn invoke_signed(
440 &self,
441 signers_seeds: &[&[&[u8]]],
442 ) -> solana_program::entrypoint::ProgramResult {
443 self.invoke_signed_with_remaining_accounts(signers_seeds, &[])
444 }
445 #[allow(clippy::clone_on_copy)]
446 #[allow(clippy::vec_init_then_push)]
447 pub fn invoke_signed_with_remaining_accounts(
448 &self,
449 signers_seeds: &[&[&[u8]]],
450 remaining_accounts: &[(
451 &'b solana_program::account_info::AccountInfo<'a>,
452 bool,
453 bool,
454 )],
455 ) -> solana_program::entrypoint::ProgramResult {
456 let mut accounts = Vec::with_capacity(11 + remaining_accounts.len());
457 accounts.push(solana_program::instruction::AccountMeta::new_readonly(
458 *self.authority.key,
459 true,
460 ));
461 if let Some(delegate_record) = self.delegate_record {
462 accounts.push(solana_program::instruction::AccountMeta::new_readonly(
463 *delegate_record.key,
464 false,
465 ));
466 } else {
467 accounts.push(solana_program::instruction::AccountMeta::new_readonly(
468 crate::MPL_TOKEN_METADATA_ID,
469 false,
470 ));
471 }
472 if let Some(token) = self.token {
473 accounts.push(solana_program::instruction::AccountMeta::new_readonly(
474 *token.key, false,
475 ));
476 } else {
477 accounts.push(solana_program::instruction::AccountMeta::new_readonly(
478 crate::MPL_TOKEN_METADATA_ID,
479 false,
480 ));
481 }
482 accounts.push(solana_program::instruction::AccountMeta::new_readonly(
483 *self.mint.key,
484 false,
485 ));
486 accounts.push(solana_program::instruction::AccountMeta::new(
487 *self.metadata.key,
488 false,
489 ));
490 if let Some(edition) = self.edition {
491 accounts.push(solana_program::instruction::AccountMeta::new_readonly(
492 *edition.key,
493 false,
494 ));
495 } else {
496 accounts.push(solana_program::instruction::AccountMeta::new_readonly(
497 crate::MPL_TOKEN_METADATA_ID,
498 false,
499 ));
500 }
501 accounts.push(solana_program::instruction::AccountMeta::new(
502 *self.payer.key,
503 true,
504 ));
505 accounts.push(solana_program::instruction::AccountMeta::new_readonly(
506 *self.system_program.key,
507 false,
508 ));
509 accounts.push(solana_program::instruction::AccountMeta::new_readonly(
510 *self.sysvar_instructions.key,
511 false,
512 ));
513 if let Some(authorization_rules_program) = self.authorization_rules_program {
514 accounts.push(solana_program::instruction::AccountMeta::new_readonly(
515 *authorization_rules_program.key,
516 false,
517 ));
518 } else {
519 accounts.push(solana_program::instruction::AccountMeta::new_readonly(
520 crate::MPL_TOKEN_METADATA_ID,
521 false,
522 ));
523 }
524 if let Some(authorization_rules) = self.authorization_rules {
525 accounts.push(solana_program::instruction::AccountMeta::new_readonly(
526 *authorization_rules.key,
527 false,
528 ));
529 } else {
530 accounts.push(solana_program::instruction::AccountMeta::new_readonly(
531 crate::MPL_TOKEN_METADATA_ID,
532 false,
533 ));
534 }
535 remaining_accounts.iter().for_each(|remaining_account| {
536 accounts.push(solana_program::instruction::AccountMeta {
537 pubkey: *remaining_account.0.key,
538 is_signer: remaining_account.1,
539 is_writable: remaining_account.2,
540 })
541 });
542 let mut data = UpdateAsDataDelegateV2InstructionData::new()
543 .try_to_vec()
544 .unwrap();
545 let mut args = self.__args.try_to_vec().unwrap();
546 data.append(&mut args);
547
548 let instruction = solana_program::instruction::Instruction {
549 program_id: crate::MPL_TOKEN_METADATA_ID,
550 accounts,
551 data,
552 };
553 let mut account_infos = Vec::with_capacity(11 + 1 + remaining_accounts.len());
554 account_infos.push(self.__program.clone());
555 account_infos.push(self.authority.clone());
556 if let Some(delegate_record) = self.delegate_record {
557 account_infos.push(delegate_record.clone());
558 }
559 if let Some(token) = self.token {
560 account_infos.push(token.clone());
561 }
562 account_infos.push(self.mint.clone());
563 account_infos.push(self.metadata.clone());
564 if let Some(edition) = self.edition {
565 account_infos.push(edition.clone());
566 }
567 account_infos.push(self.payer.clone());
568 account_infos.push(self.system_program.clone());
569 account_infos.push(self.sysvar_instructions.clone());
570 if let Some(authorization_rules_program) = self.authorization_rules_program {
571 account_infos.push(authorization_rules_program.clone());
572 }
573 if let Some(authorization_rules) = self.authorization_rules {
574 account_infos.push(authorization_rules.clone());
575 }
576 remaining_accounts
577 .iter()
578 .for_each(|remaining_account| account_infos.push(remaining_account.0.clone()));
579
580 if signers_seeds.is_empty() {
581 solana_program::program::invoke(&instruction, &account_infos)
582 } else {
583 solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds)
584 }
585 }
586}
587
588pub struct UpdateAsDataDelegateV2CpiBuilder<'a, 'b> {
604 instruction: Box<UpdateAsDataDelegateV2CpiBuilderInstruction<'a, 'b>>,
605}
606
607impl<'a, 'b> UpdateAsDataDelegateV2CpiBuilder<'a, 'b> {
608 pub fn new(program: &'b solana_program::account_info::AccountInfo<'a>) -> Self {
609 let instruction = Box::new(UpdateAsDataDelegateV2CpiBuilderInstruction {
610 __program: program,
611 authority: None,
612 delegate_record: None,
613 token: None,
614 mint: None,
615 metadata: None,
616 edition: None,
617 payer: None,
618 system_program: None,
619 sysvar_instructions: None,
620 authorization_rules_program: None,
621 authorization_rules: None,
622 data: None,
623 authorization_data: None,
624 __remaining_accounts: Vec::new(),
625 });
626 Self { instruction }
627 }
628 #[inline(always)]
630 pub fn authority(
631 &mut self,
632 authority: &'b solana_program::account_info::AccountInfo<'a>,
633 ) -> &mut Self {
634 self.instruction.authority = Some(authority);
635 self
636 }
637 #[inline(always)]
640 pub fn delegate_record(
641 &mut self,
642 delegate_record: Option<&'b solana_program::account_info::AccountInfo<'a>>,
643 ) -> &mut Self {
644 self.instruction.delegate_record = delegate_record;
645 self
646 }
647 #[inline(always)]
650 pub fn token(
651 &mut self,
652 token: Option<&'b solana_program::account_info::AccountInfo<'a>>,
653 ) -> &mut Self {
654 self.instruction.token = token;
655 self
656 }
657 #[inline(always)]
659 pub fn mint(&mut self, mint: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self {
660 self.instruction.mint = Some(mint);
661 self
662 }
663 #[inline(always)]
665 pub fn metadata(
666 &mut self,
667 metadata: &'b solana_program::account_info::AccountInfo<'a>,
668 ) -> &mut Self {
669 self.instruction.metadata = Some(metadata);
670 self
671 }
672 #[inline(always)]
675 pub fn edition(
676 &mut self,
677 edition: Option<&'b solana_program::account_info::AccountInfo<'a>>,
678 ) -> &mut Self {
679 self.instruction.edition = edition;
680 self
681 }
682 #[inline(always)]
684 pub fn payer(&mut self, payer: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self {
685 self.instruction.payer = Some(payer);
686 self
687 }
688 #[inline(always)]
690 pub fn system_program(
691 &mut self,
692 system_program: &'b solana_program::account_info::AccountInfo<'a>,
693 ) -> &mut Self {
694 self.instruction.system_program = Some(system_program);
695 self
696 }
697 #[inline(always)]
699 pub fn sysvar_instructions(
700 &mut self,
701 sysvar_instructions: &'b solana_program::account_info::AccountInfo<'a>,
702 ) -> &mut Self {
703 self.instruction.sysvar_instructions = Some(sysvar_instructions);
704 self
705 }
706 #[inline(always)]
709 pub fn authorization_rules_program(
710 &mut self,
711 authorization_rules_program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
712 ) -> &mut Self {
713 self.instruction.authorization_rules_program = authorization_rules_program;
714 self
715 }
716 #[inline(always)]
719 pub fn authorization_rules(
720 &mut self,
721 authorization_rules: Option<&'b solana_program::account_info::AccountInfo<'a>>,
722 ) -> &mut Self {
723 self.instruction.authorization_rules = authorization_rules;
724 self
725 }
726 #[inline(always)]
728 pub fn data(&mut self, data: Data) -> &mut Self {
729 self.instruction.data = Some(data);
730 self
731 }
732 #[inline(always)]
734 pub fn authorization_data(&mut self, authorization_data: AuthorizationData) -> &mut Self {
735 self.instruction.authorization_data = Some(authorization_data);
736 self
737 }
738 #[inline(always)]
740 pub fn add_remaining_account(
741 &mut self,
742 account: &'b solana_program::account_info::AccountInfo<'a>,
743 is_writable: bool,
744 is_signer: bool,
745 ) -> &mut Self {
746 self.instruction
747 .__remaining_accounts
748 .push((account, is_writable, is_signer));
749 self
750 }
751 #[inline(always)]
756 pub fn add_remaining_accounts(
757 &mut self,
758 accounts: &[(
759 &'b solana_program::account_info::AccountInfo<'a>,
760 bool,
761 bool,
762 )],
763 ) -> &mut Self {
764 self.instruction
765 .__remaining_accounts
766 .extend_from_slice(accounts);
767 self
768 }
769 #[inline(always)]
770 pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult {
771 self.invoke_signed(&[])
772 }
773 #[allow(clippy::clone_on_copy)]
774 #[allow(clippy::vec_init_then_push)]
775 pub fn invoke_signed(
776 &self,
777 signers_seeds: &[&[&[u8]]],
778 ) -> solana_program::entrypoint::ProgramResult {
779 let args = UpdateAsDataDelegateV2InstructionArgs {
780 data: self.instruction.data.clone(),
781 authorization_data: self.instruction.authorization_data.clone(),
782 };
783 let instruction = UpdateAsDataDelegateV2Cpi {
784 __program: self.instruction.__program,
785
786 authority: self.instruction.authority.expect("authority is not set"),
787
788 delegate_record: self.instruction.delegate_record,
789
790 token: self.instruction.token,
791
792 mint: self.instruction.mint.expect("mint is not set"),
793
794 metadata: self.instruction.metadata.expect("metadata is not set"),
795
796 edition: self.instruction.edition,
797
798 payer: self.instruction.payer.expect("payer is not set"),
799
800 system_program: self
801 .instruction
802 .system_program
803 .expect("system_program is not set"),
804
805 sysvar_instructions: self
806 .instruction
807 .sysvar_instructions
808 .expect("sysvar_instructions is not set"),
809
810 authorization_rules_program: self.instruction.authorization_rules_program,
811
812 authorization_rules: self.instruction.authorization_rules,
813 __args: args,
814 };
815 instruction.invoke_signed_with_remaining_accounts(
816 signers_seeds,
817 &self.instruction.__remaining_accounts,
818 )
819 }
820}
821
822struct UpdateAsDataDelegateV2CpiBuilderInstruction<'a, 'b> {
823 __program: &'b solana_program::account_info::AccountInfo<'a>,
824 authority: Option<&'b solana_program::account_info::AccountInfo<'a>>,
825 delegate_record: Option<&'b solana_program::account_info::AccountInfo<'a>>,
826 token: Option<&'b solana_program::account_info::AccountInfo<'a>>,
827 mint: Option<&'b solana_program::account_info::AccountInfo<'a>>,
828 metadata: Option<&'b solana_program::account_info::AccountInfo<'a>>,
829 edition: Option<&'b solana_program::account_info::AccountInfo<'a>>,
830 payer: Option<&'b solana_program::account_info::AccountInfo<'a>>,
831 system_program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
832 sysvar_instructions: Option<&'b solana_program::account_info::AccountInfo<'a>>,
833 authorization_rules_program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
834 authorization_rules: Option<&'b solana_program::account_info::AccountInfo<'a>>,
835 data: Option<Data>,
836 authorization_data: Option<AuthorizationData>,
837 __remaining_accounts: Vec<(
839 &'b solana_program::account_info::AccountInfo<'a>,
840 bool,
841 bool,
842 )>,
843}