tensor_amm/generated/instructions/
sell_nft_token_pool.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 crate::generated::types::AuthorizationDataLocal;
9use borsh::BorshDeserialize;
10use borsh::BorshSerialize;
11
12/// Accounts.
13pub struct SellNftTokenPool {
14    /// The owner of the pool and the buyer/recipient of the NFT.
15    pub owner: solana_program::pubkey::Pubkey,
16    /// The taker is the user buying or selling the NFT.
17    pub taker: solana_program::pubkey::Pubkey,
18    /// The original rent payer of the pool--stored on the pool. Used to refund rent in case the pool
19    /// is auto-closed.
20    pub rent_payer: solana_program::pubkey::Pubkey,
21    /// Fee vault account owned by the TFEE program.
22    pub fee_vault: solana_program::pubkey::Pubkey,
23    /// The Pool state account that the NFT is being sold into. Stores pool state and config,
24    /// but is also the owner of any NFTs in the pool, and also escrows any SOL.
25    /// Any active pool can be specified provided it is a Token type and the NFT passes at least one
26    /// whitelist condition.
27    pub pool: solana_program::pubkey::Pubkey,
28    /// The whitelist account that the pool uses to verify the NFTs being sold into it.
29    pub whitelist: solana_program::pubkey::Pubkey,
30    /// Optional account which must be passed in if the NFT must be verified against a
31    /// merkle proof condition in the whitelist.
32    pub mint_proof: Option<solana_program::pubkey::Pubkey>,
33    /// The shared escrow account for pools that have liquidity in a shared account.
34    pub shared_escrow: Option<solana_program::pubkey::Pubkey>,
35    /// The account that receives the maker broker fee.
36    pub maker_broker: Option<solana_program::pubkey::Pubkey>,
37    /// The account that receives the taker broker fee.
38    pub taker_broker: Option<solana_program::pubkey::Pubkey>,
39    /// The optional cosigner account that must be passed in if the pool has a cosigner.
40    pub cosigner: Option<solana_program::pubkey::Pubkey>,
41    /// The AMM program account, used for self-cpi logging.
42    pub amm_program: solana_program::pubkey::Pubkey,
43    /// The escrow program account for shared liquidity pools.
44    pub escrow_program: Option<solana_program::pubkey::Pubkey>,
45
46    pub native_program: solana_program::pubkey::Pubkey,
47    /// The mint account of the NFT.
48    pub mint: solana_program::pubkey::Pubkey,
49    /// The Token Metadata metadata account of the NFT.
50    pub metadata: solana_program::pubkey::Pubkey,
51    /// The Token Metadata edition account of the NFT.
52    pub edition: solana_program::pubkey::Pubkey,
53    /// The Token Metadata source token record account of the NFT.
54    pub user_token_record: Option<solana_program::pubkey::Pubkey>,
55    /// The Token Metadata token record for the destination.
56    pub pool_token_record: Option<solana_program::pubkey::Pubkey>,
57    /// The Token Metadata program account.
58    pub token_metadata_program: Option<solana_program::pubkey::Pubkey>,
59    /// The sysvar instructions account.
60    pub sysvar_instructions: Option<solana_program::pubkey::Pubkey>,
61    /// The Metaplex Token Authority Rules account that stores royalty enforcement rules.
62    pub authorization_rules: Option<solana_program::pubkey::Pubkey>,
63    /// The Metaplex Token Authority Rules program account.
64    pub authorization_rules_program: Option<solana_program::pubkey::Pubkey>,
65    /// The token account of the NFT for the seller's wallet.
66    pub taker_ta: solana_program::pubkey::Pubkey,
67    /// The TA of the owner, where the NFT will be transferred to as a result of this sale.
68    pub owner_ta: solana_program::pubkey::Pubkey,
69    /// The TA of the pool, where the NFT token is temporarily escrowed as a result of this sale.
70    pub pool_ta: solana_program::pubkey::Pubkey,
71    /// The Token Metadata owner/buyer token record account of the NFT.
72    pub owner_token_record: Option<solana_program::pubkey::Pubkey>,
73    /// Either the legacy token program or token-2022.
74    pub token_program: solana_program::pubkey::Pubkey,
75    /// The SPL associated token program.
76    pub associated_token_program: solana_program::pubkey::Pubkey,
77    /// The Solana system program.
78    pub system_program: solana_program::pubkey::Pubkey,
79}
80
81impl SellNftTokenPool {
82    pub fn instruction(
83        &self,
84        args: SellNftTokenPoolInstructionArgs,
85    ) -> solana_program::instruction::Instruction {
86        self.instruction_with_remaining_accounts(args, &[])
87    }
88    #[allow(clippy::vec_init_then_push)]
89    pub fn instruction_with_remaining_accounts(
90        &self,
91        args: SellNftTokenPoolInstructionArgs,
92        remaining_accounts: &[solana_program::instruction::AccountMeta],
93    ) -> solana_program::instruction::Instruction {
94        let mut accounts = Vec::with_capacity(30 + remaining_accounts.len());
95        accounts.push(solana_program::instruction::AccountMeta::new(
96            self.owner, false,
97        ));
98        accounts.push(solana_program::instruction::AccountMeta::new(
99            self.taker, true,
100        ));
101        accounts.push(solana_program::instruction::AccountMeta::new(
102            self.rent_payer,
103            false,
104        ));
105        accounts.push(solana_program::instruction::AccountMeta::new(
106            self.fee_vault,
107            false,
108        ));
109        accounts.push(solana_program::instruction::AccountMeta::new(
110            self.pool, false,
111        ));
112        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
113            self.whitelist,
114            false,
115        ));
116        if let Some(mint_proof) = self.mint_proof {
117            accounts.push(solana_program::instruction::AccountMeta::new_readonly(
118                mint_proof, false,
119            ));
120        } else {
121            accounts.push(solana_program::instruction::AccountMeta::new_readonly(
122                crate::TENSOR_AMM_ID,
123                false,
124            ));
125        }
126        if let Some(shared_escrow) = self.shared_escrow {
127            accounts.push(solana_program::instruction::AccountMeta::new(
128                shared_escrow,
129                false,
130            ));
131        } else {
132            accounts.push(solana_program::instruction::AccountMeta::new_readonly(
133                crate::TENSOR_AMM_ID,
134                false,
135            ));
136        }
137        if let Some(maker_broker) = self.maker_broker {
138            accounts.push(solana_program::instruction::AccountMeta::new(
139                maker_broker,
140                false,
141            ));
142        } else {
143            accounts.push(solana_program::instruction::AccountMeta::new_readonly(
144                crate::TENSOR_AMM_ID,
145                false,
146            ));
147        }
148        if let Some(taker_broker) = self.taker_broker {
149            accounts.push(solana_program::instruction::AccountMeta::new(
150                taker_broker,
151                false,
152            ));
153        } else {
154            accounts.push(solana_program::instruction::AccountMeta::new_readonly(
155                crate::TENSOR_AMM_ID,
156                false,
157            ));
158        }
159        if let Some(cosigner) = self.cosigner {
160            accounts.push(solana_program::instruction::AccountMeta::new_readonly(
161                cosigner, true,
162            ));
163        } else {
164            accounts.push(solana_program::instruction::AccountMeta::new_readonly(
165                crate::TENSOR_AMM_ID,
166                false,
167            ));
168        }
169        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
170            self.amm_program,
171            false,
172        ));
173        if let Some(escrow_program) = self.escrow_program {
174            accounts.push(solana_program::instruction::AccountMeta::new_readonly(
175                escrow_program,
176                false,
177            ));
178        } else {
179            accounts.push(solana_program::instruction::AccountMeta::new_readonly(
180                crate::TENSOR_AMM_ID,
181                false,
182            ));
183        }
184        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
185            self.native_program,
186            false,
187        ));
188        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
189            self.mint, false,
190        ));
191        accounts.push(solana_program::instruction::AccountMeta::new(
192            self.metadata,
193            false,
194        ));
195        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
196            self.edition,
197            false,
198        ));
199        if let Some(user_token_record) = self.user_token_record {
200            accounts.push(solana_program::instruction::AccountMeta::new(
201                user_token_record,
202                false,
203            ));
204        } else {
205            accounts.push(solana_program::instruction::AccountMeta::new_readonly(
206                crate::TENSOR_AMM_ID,
207                false,
208            ));
209        }
210        if let Some(pool_token_record) = self.pool_token_record {
211            accounts.push(solana_program::instruction::AccountMeta::new(
212                pool_token_record,
213                false,
214            ));
215        } else {
216            accounts.push(solana_program::instruction::AccountMeta::new_readonly(
217                crate::TENSOR_AMM_ID,
218                false,
219            ));
220        }
221        if let Some(token_metadata_program) = self.token_metadata_program {
222            accounts.push(solana_program::instruction::AccountMeta::new_readonly(
223                token_metadata_program,
224                false,
225            ));
226        } else {
227            accounts.push(solana_program::instruction::AccountMeta::new_readonly(
228                crate::TENSOR_AMM_ID,
229                false,
230            ));
231        }
232        if let Some(sysvar_instructions) = self.sysvar_instructions {
233            accounts.push(solana_program::instruction::AccountMeta::new_readonly(
234                sysvar_instructions,
235                false,
236            ));
237        } else {
238            accounts.push(solana_program::instruction::AccountMeta::new_readonly(
239                crate::TENSOR_AMM_ID,
240                false,
241            ));
242        }
243        if let Some(authorization_rules) = self.authorization_rules {
244            accounts.push(solana_program::instruction::AccountMeta::new_readonly(
245                authorization_rules,
246                false,
247            ));
248        } else {
249            accounts.push(solana_program::instruction::AccountMeta::new_readonly(
250                crate::TENSOR_AMM_ID,
251                false,
252            ));
253        }
254        if let Some(authorization_rules_program) = self.authorization_rules_program {
255            accounts.push(solana_program::instruction::AccountMeta::new_readonly(
256                authorization_rules_program,
257                false,
258            ));
259        } else {
260            accounts.push(solana_program::instruction::AccountMeta::new_readonly(
261                crate::TENSOR_AMM_ID,
262                false,
263            ));
264        }
265        accounts.push(solana_program::instruction::AccountMeta::new(
266            self.taker_ta,
267            false,
268        ));
269        accounts.push(solana_program::instruction::AccountMeta::new(
270            self.owner_ta,
271            false,
272        ));
273        accounts.push(solana_program::instruction::AccountMeta::new(
274            self.pool_ta,
275            false,
276        ));
277        if let Some(owner_token_record) = self.owner_token_record {
278            accounts.push(solana_program::instruction::AccountMeta::new(
279                owner_token_record,
280                false,
281            ));
282        } else {
283            accounts.push(solana_program::instruction::AccountMeta::new_readonly(
284                crate::TENSOR_AMM_ID,
285                false,
286            ));
287        }
288        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
289            self.token_program,
290            false,
291        ));
292        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
293            self.associated_token_program,
294            false,
295        ));
296        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
297            self.system_program,
298            false,
299        ));
300        accounts.extend_from_slice(remaining_accounts);
301        let mut data = SellNftTokenPoolInstructionData::new().try_to_vec().unwrap();
302        let mut args = args.try_to_vec().unwrap();
303        data.append(&mut args);
304
305        solana_program::instruction::Instruction {
306            program_id: crate::TENSOR_AMM_ID,
307            accounts,
308            data,
309        }
310    }
311}
312
313#[derive(BorshDeserialize, BorshSerialize)]
314pub struct SellNftTokenPoolInstructionData {
315    discriminator: [u8; 8],
316}
317
318impl SellNftTokenPoolInstructionData {
319    pub fn new() -> Self {
320        Self {
321            discriminator: [57, 44, 192, 48, 83, 8, 107, 48],
322        }
323    }
324}
325
326impl Default for SellNftTokenPoolInstructionData {
327    fn default() -> Self {
328        Self::new()
329    }
330}
331
332#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
333#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
334pub struct SellNftTokenPoolInstructionArgs {
335    pub min_price: u64,
336    pub authorization_data: Option<AuthorizationDataLocal>,
337    pub optional_royalty_pct: Option<u16>,
338}
339
340/// Instruction builder for `SellNftTokenPool`.
341///
342/// ### Accounts:
343///
344///   0. `[writable]` owner
345///   1. `[writable, signer]` taker
346///   2. `[writable]` rent_payer
347///   3. `[writable]` fee_vault
348///   4. `[writable]` pool
349///   5. `[]` whitelist
350///   6. `[optional]` mint_proof
351///   7. `[writable, optional]` shared_escrow
352///   8. `[writable, optional]` maker_broker
353///   9. `[writable, optional]` taker_broker
354///   10. `[signer, optional]` cosigner
355///   11. `[optional]` amm_program (default to `TAMM6ub33ij1mbetoMyVBLeKY5iP41i4UPUJQGkhfsg`)
356///   12. `[optional]` escrow_program
357///   13. `[optional]` native_program (default to `11111111111111111111111111111111`)
358///   14. `[]` mint
359///   15. `[writable]` metadata
360///   16. `[]` edition
361///   17. `[writable, optional]` user_token_record
362///   18. `[writable, optional]` pool_token_record
363///   19. `[optional]` token_metadata_program
364///   20. `[optional]` sysvar_instructions
365///   21. `[optional]` authorization_rules
366///   22. `[optional]` authorization_rules_program
367///   23. `[writable]` taker_ta
368///   24. `[writable]` owner_ta
369///   25. `[writable]` pool_ta
370///   26. `[writable, optional]` owner_token_record
371///   27. `[optional]` token_program (default to `TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA`)
372///   28. `[optional]` associated_token_program (default to `ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL`)
373///   29. `[optional]` system_program (default to `11111111111111111111111111111111`)
374#[derive(Clone, Debug, Default)]
375pub struct SellNftTokenPoolBuilder {
376    owner: Option<solana_program::pubkey::Pubkey>,
377    taker: Option<solana_program::pubkey::Pubkey>,
378    rent_payer: Option<solana_program::pubkey::Pubkey>,
379    fee_vault: Option<solana_program::pubkey::Pubkey>,
380    pool: Option<solana_program::pubkey::Pubkey>,
381    whitelist: Option<solana_program::pubkey::Pubkey>,
382    mint_proof: Option<solana_program::pubkey::Pubkey>,
383    shared_escrow: Option<solana_program::pubkey::Pubkey>,
384    maker_broker: Option<solana_program::pubkey::Pubkey>,
385    taker_broker: Option<solana_program::pubkey::Pubkey>,
386    cosigner: Option<solana_program::pubkey::Pubkey>,
387    amm_program: Option<solana_program::pubkey::Pubkey>,
388    escrow_program: Option<solana_program::pubkey::Pubkey>,
389    native_program: Option<solana_program::pubkey::Pubkey>,
390    mint: Option<solana_program::pubkey::Pubkey>,
391    metadata: Option<solana_program::pubkey::Pubkey>,
392    edition: Option<solana_program::pubkey::Pubkey>,
393    user_token_record: Option<solana_program::pubkey::Pubkey>,
394    pool_token_record: Option<solana_program::pubkey::Pubkey>,
395    token_metadata_program: Option<solana_program::pubkey::Pubkey>,
396    sysvar_instructions: Option<solana_program::pubkey::Pubkey>,
397    authorization_rules: Option<solana_program::pubkey::Pubkey>,
398    authorization_rules_program: Option<solana_program::pubkey::Pubkey>,
399    taker_ta: Option<solana_program::pubkey::Pubkey>,
400    owner_ta: Option<solana_program::pubkey::Pubkey>,
401    pool_ta: Option<solana_program::pubkey::Pubkey>,
402    owner_token_record: Option<solana_program::pubkey::Pubkey>,
403    token_program: Option<solana_program::pubkey::Pubkey>,
404    associated_token_program: Option<solana_program::pubkey::Pubkey>,
405    system_program: Option<solana_program::pubkey::Pubkey>,
406    min_price: Option<u64>,
407    authorization_data: Option<AuthorizationDataLocal>,
408    optional_royalty_pct: Option<u16>,
409    __remaining_accounts: Vec<solana_program::instruction::AccountMeta>,
410}
411
412impl SellNftTokenPoolBuilder {
413    pub fn new() -> Self {
414        Self::default()
415    }
416    /// The owner of the pool and the buyer/recipient of the NFT.
417    #[inline(always)]
418    pub fn owner(&mut self, owner: solana_program::pubkey::Pubkey) -> &mut Self {
419        self.owner = Some(owner);
420        self
421    }
422    /// The taker is the user buying or selling the NFT.
423    #[inline(always)]
424    pub fn taker(&mut self, taker: solana_program::pubkey::Pubkey) -> &mut Self {
425        self.taker = Some(taker);
426        self
427    }
428    /// The original rent payer of the pool--stored on the pool. Used to refund rent in case the pool
429    /// is auto-closed.
430    #[inline(always)]
431    pub fn rent_payer(&mut self, rent_payer: solana_program::pubkey::Pubkey) -> &mut Self {
432        self.rent_payer = Some(rent_payer);
433        self
434    }
435    /// Fee vault account owned by the TFEE program.
436    #[inline(always)]
437    pub fn fee_vault(&mut self, fee_vault: solana_program::pubkey::Pubkey) -> &mut Self {
438        self.fee_vault = Some(fee_vault);
439        self
440    }
441    /// The Pool state account that the NFT is being sold into. Stores pool state and config,
442    /// but is also the owner of any NFTs in the pool, and also escrows any SOL.
443    /// Any active pool can be specified provided it is a Token type and the NFT passes at least one
444    /// whitelist condition.
445    #[inline(always)]
446    pub fn pool(&mut self, pool: solana_program::pubkey::Pubkey) -> &mut Self {
447        self.pool = Some(pool);
448        self
449    }
450    /// The whitelist account that the pool uses to verify the NFTs being sold into it.
451    #[inline(always)]
452    pub fn whitelist(&mut self, whitelist: solana_program::pubkey::Pubkey) -> &mut Self {
453        self.whitelist = Some(whitelist);
454        self
455    }
456    /// `[optional account]`
457    /// Optional account which must be passed in if the NFT must be verified against a
458    /// merkle proof condition in the whitelist.
459    #[inline(always)]
460    pub fn mint_proof(&mut self, mint_proof: Option<solana_program::pubkey::Pubkey>) -> &mut Self {
461        self.mint_proof = mint_proof;
462        self
463    }
464    /// `[optional account]`
465    /// The shared escrow account for pools that have liquidity in a shared account.
466    #[inline(always)]
467    pub fn shared_escrow(
468        &mut self,
469        shared_escrow: Option<solana_program::pubkey::Pubkey>,
470    ) -> &mut Self {
471        self.shared_escrow = shared_escrow;
472        self
473    }
474    /// `[optional account]`
475    /// The account that receives the maker broker fee.
476    #[inline(always)]
477    pub fn maker_broker(
478        &mut self,
479        maker_broker: Option<solana_program::pubkey::Pubkey>,
480    ) -> &mut Self {
481        self.maker_broker = maker_broker;
482        self
483    }
484    /// `[optional account]`
485    /// The account that receives the taker broker fee.
486    #[inline(always)]
487    pub fn taker_broker(
488        &mut self,
489        taker_broker: Option<solana_program::pubkey::Pubkey>,
490    ) -> &mut Self {
491        self.taker_broker = taker_broker;
492        self
493    }
494    /// `[optional account]`
495    /// The optional cosigner account that must be passed in if the pool has a cosigner.
496    #[inline(always)]
497    pub fn cosigner(&mut self, cosigner: Option<solana_program::pubkey::Pubkey>) -> &mut Self {
498        self.cosigner = cosigner;
499        self
500    }
501    /// `[optional account, default to 'TAMM6ub33ij1mbetoMyVBLeKY5iP41i4UPUJQGkhfsg']`
502    /// The AMM program account, used for self-cpi logging.
503    #[inline(always)]
504    pub fn amm_program(&mut self, amm_program: solana_program::pubkey::Pubkey) -> &mut Self {
505        self.amm_program = Some(amm_program);
506        self
507    }
508    /// `[optional account]`
509    /// The escrow program account for shared liquidity pools.
510    #[inline(always)]
511    pub fn escrow_program(
512        &mut self,
513        escrow_program: Option<solana_program::pubkey::Pubkey>,
514    ) -> &mut Self {
515        self.escrow_program = escrow_program;
516        self
517    }
518    /// `[optional account, default to '11111111111111111111111111111111']`
519    #[inline(always)]
520    pub fn native_program(&mut self, native_program: solana_program::pubkey::Pubkey) -> &mut Self {
521        self.native_program = Some(native_program);
522        self
523    }
524    /// The mint account of the NFT.
525    #[inline(always)]
526    pub fn mint(&mut self, mint: solana_program::pubkey::Pubkey) -> &mut Self {
527        self.mint = Some(mint);
528        self
529    }
530    /// The Token Metadata metadata account of the NFT.
531    #[inline(always)]
532    pub fn metadata(&mut self, metadata: solana_program::pubkey::Pubkey) -> &mut Self {
533        self.metadata = Some(metadata);
534        self
535    }
536    /// The Token Metadata edition account of the NFT.
537    #[inline(always)]
538    pub fn edition(&mut self, edition: solana_program::pubkey::Pubkey) -> &mut Self {
539        self.edition = Some(edition);
540        self
541    }
542    /// `[optional account]`
543    /// The Token Metadata source token record account of the NFT.
544    #[inline(always)]
545    pub fn user_token_record(
546        &mut self,
547        user_token_record: Option<solana_program::pubkey::Pubkey>,
548    ) -> &mut Self {
549        self.user_token_record = user_token_record;
550        self
551    }
552    /// `[optional account]`
553    /// The Token Metadata token record for the destination.
554    #[inline(always)]
555    pub fn pool_token_record(
556        &mut self,
557        pool_token_record: Option<solana_program::pubkey::Pubkey>,
558    ) -> &mut Self {
559        self.pool_token_record = pool_token_record;
560        self
561    }
562    /// `[optional account]`
563    /// The Token Metadata program account.
564    #[inline(always)]
565    pub fn token_metadata_program(
566        &mut self,
567        token_metadata_program: Option<solana_program::pubkey::Pubkey>,
568    ) -> &mut Self {
569        self.token_metadata_program = token_metadata_program;
570        self
571    }
572    /// `[optional account]`
573    /// The sysvar instructions account.
574    #[inline(always)]
575    pub fn sysvar_instructions(
576        &mut self,
577        sysvar_instructions: Option<solana_program::pubkey::Pubkey>,
578    ) -> &mut Self {
579        self.sysvar_instructions = sysvar_instructions;
580        self
581    }
582    /// `[optional account]`
583    /// The Metaplex Token Authority Rules account that stores royalty enforcement rules.
584    #[inline(always)]
585    pub fn authorization_rules(
586        &mut self,
587        authorization_rules: Option<solana_program::pubkey::Pubkey>,
588    ) -> &mut Self {
589        self.authorization_rules = authorization_rules;
590        self
591    }
592    /// `[optional account]`
593    /// The Metaplex Token Authority Rules program account.
594    #[inline(always)]
595    pub fn authorization_rules_program(
596        &mut self,
597        authorization_rules_program: Option<solana_program::pubkey::Pubkey>,
598    ) -> &mut Self {
599        self.authorization_rules_program = authorization_rules_program;
600        self
601    }
602    /// The token account of the NFT for the seller's wallet.
603    #[inline(always)]
604    pub fn taker_ta(&mut self, taker_ta: solana_program::pubkey::Pubkey) -> &mut Self {
605        self.taker_ta = Some(taker_ta);
606        self
607    }
608    /// The TA of the owner, where the NFT will be transferred to as a result of this sale.
609    #[inline(always)]
610    pub fn owner_ta(&mut self, owner_ta: solana_program::pubkey::Pubkey) -> &mut Self {
611        self.owner_ta = Some(owner_ta);
612        self
613    }
614    /// The TA of the pool, where the NFT token is temporarily escrowed as a result of this sale.
615    #[inline(always)]
616    pub fn pool_ta(&mut self, pool_ta: solana_program::pubkey::Pubkey) -> &mut Self {
617        self.pool_ta = Some(pool_ta);
618        self
619    }
620    /// `[optional account]`
621    /// The Token Metadata owner/buyer token record account of the NFT.
622    #[inline(always)]
623    pub fn owner_token_record(
624        &mut self,
625        owner_token_record: Option<solana_program::pubkey::Pubkey>,
626    ) -> &mut Self {
627        self.owner_token_record = owner_token_record;
628        self
629    }
630    /// `[optional account, default to 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA']`
631    /// Either the legacy token program or token-2022.
632    #[inline(always)]
633    pub fn token_program(&mut self, token_program: solana_program::pubkey::Pubkey) -> &mut Self {
634        self.token_program = Some(token_program);
635        self
636    }
637    /// `[optional account, default to 'ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL']`
638    /// The SPL associated token program.
639    #[inline(always)]
640    pub fn associated_token_program(
641        &mut self,
642        associated_token_program: solana_program::pubkey::Pubkey,
643    ) -> &mut Self {
644        self.associated_token_program = Some(associated_token_program);
645        self
646    }
647    /// `[optional account, default to '11111111111111111111111111111111']`
648    /// The Solana system program.
649    #[inline(always)]
650    pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self {
651        self.system_program = Some(system_program);
652        self
653    }
654    #[inline(always)]
655    pub fn min_price(&mut self, min_price: u64) -> &mut Self {
656        self.min_price = Some(min_price);
657        self
658    }
659    /// `[optional argument]`
660    #[inline(always)]
661    pub fn authorization_data(&mut self, authorization_data: AuthorizationDataLocal) -> &mut Self {
662        self.authorization_data = Some(authorization_data);
663        self
664    }
665    /// `[optional argument]`
666    #[inline(always)]
667    pub fn optional_royalty_pct(&mut self, optional_royalty_pct: u16) -> &mut Self {
668        self.optional_royalty_pct = Some(optional_royalty_pct);
669        self
670    }
671    /// Add an additional account to the instruction.
672    #[inline(always)]
673    pub fn add_remaining_account(
674        &mut self,
675        account: solana_program::instruction::AccountMeta,
676    ) -> &mut Self {
677        self.__remaining_accounts.push(account);
678        self
679    }
680    /// Add additional accounts to the instruction.
681    #[inline(always)]
682    pub fn add_remaining_accounts(
683        &mut self,
684        accounts: &[solana_program::instruction::AccountMeta],
685    ) -> &mut Self {
686        self.__remaining_accounts.extend_from_slice(accounts);
687        self
688    }
689    #[allow(clippy::clone_on_copy)]
690    pub fn instruction(&self) -> solana_program::instruction::Instruction {
691        let accounts = SellNftTokenPool {
692            owner: self.owner.expect("owner is not set"),
693            taker: self.taker.expect("taker is not set"),
694            rent_payer: self.rent_payer.expect("rent_payer is not set"),
695            fee_vault: self.fee_vault.expect("fee_vault is not set"),
696            pool: self.pool.expect("pool is not set"),
697            whitelist: self.whitelist.expect("whitelist is not set"),
698            mint_proof: self.mint_proof,
699            shared_escrow: self.shared_escrow,
700            maker_broker: self.maker_broker,
701            taker_broker: self.taker_broker,
702            cosigner: self.cosigner,
703            amm_program: self.amm_program.unwrap_or(solana_program::pubkey!(
704                "TAMM6ub33ij1mbetoMyVBLeKY5iP41i4UPUJQGkhfsg"
705            )),
706            escrow_program: self.escrow_program,
707            native_program: self
708                .native_program
709                .unwrap_or(solana_program::pubkey!("11111111111111111111111111111111")),
710            mint: self.mint.expect("mint is not set"),
711            metadata: self.metadata.expect("metadata is not set"),
712            edition: self.edition.expect("edition is not set"),
713            user_token_record: self.user_token_record,
714            pool_token_record: self.pool_token_record,
715            token_metadata_program: self.token_metadata_program,
716            sysvar_instructions: self.sysvar_instructions,
717            authorization_rules: self.authorization_rules,
718            authorization_rules_program: self.authorization_rules_program,
719            taker_ta: self.taker_ta.expect("taker_ta is not set"),
720            owner_ta: self.owner_ta.expect("owner_ta is not set"),
721            pool_ta: self.pool_ta.expect("pool_ta is not set"),
722            owner_token_record: self.owner_token_record,
723            token_program: self.token_program.unwrap_or(solana_program::pubkey!(
724                "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
725            )),
726            associated_token_program: self.associated_token_program.unwrap_or(
727                solana_program::pubkey!("ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"),
728            ),
729            system_program: self
730                .system_program
731                .unwrap_or(solana_program::pubkey!("11111111111111111111111111111111")),
732        };
733        let args = SellNftTokenPoolInstructionArgs {
734            min_price: self.min_price.clone().expect("min_price is not set"),
735            authorization_data: self.authorization_data.clone(),
736            optional_royalty_pct: self.optional_royalty_pct.clone(),
737        };
738
739        accounts.instruction_with_remaining_accounts(args, &self.__remaining_accounts)
740    }
741}
742
743/// `sell_nft_token_pool` CPI accounts.
744pub struct SellNftTokenPoolCpiAccounts<'a, 'b> {
745    /// The owner of the pool and the buyer/recipient of the NFT.
746    pub owner: &'b solana_program::account_info::AccountInfo<'a>,
747    /// The taker is the user buying or selling the NFT.
748    pub taker: &'b solana_program::account_info::AccountInfo<'a>,
749    /// The original rent payer of the pool--stored on the pool. Used to refund rent in case the pool
750    /// is auto-closed.
751    pub rent_payer: &'b solana_program::account_info::AccountInfo<'a>,
752    /// Fee vault account owned by the TFEE program.
753    pub fee_vault: &'b solana_program::account_info::AccountInfo<'a>,
754    /// The Pool state account that the NFT is being sold into. Stores pool state and config,
755    /// but is also the owner of any NFTs in the pool, and also escrows any SOL.
756    /// Any active pool can be specified provided it is a Token type and the NFT passes at least one
757    /// whitelist condition.
758    pub pool: &'b solana_program::account_info::AccountInfo<'a>,
759    /// The whitelist account that the pool uses to verify the NFTs being sold into it.
760    pub whitelist: &'b solana_program::account_info::AccountInfo<'a>,
761    /// Optional account which must be passed in if the NFT must be verified against a
762    /// merkle proof condition in the whitelist.
763    pub mint_proof: Option<&'b solana_program::account_info::AccountInfo<'a>>,
764    /// The shared escrow account for pools that have liquidity in a shared account.
765    pub shared_escrow: Option<&'b solana_program::account_info::AccountInfo<'a>>,
766    /// The account that receives the maker broker fee.
767    pub maker_broker: Option<&'b solana_program::account_info::AccountInfo<'a>>,
768    /// The account that receives the taker broker fee.
769    pub taker_broker: Option<&'b solana_program::account_info::AccountInfo<'a>>,
770    /// The optional cosigner account that must be passed in if the pool has a cosigner.
771    pub cosigner: Option<&'b solana_program::account_info::AccountInfo<'a>>,
772    /// The AMM program account, used for self-cpi logging.
773    pub amm_program: &'b solana_program::account_info::AccountInfo<'a>,
774    /// The escrow program account for shared liquidity pools.
775    pub escrow_program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
776
777    pub native_program: &'b solana_program::account_info::AccountInfo<'a>,
778    /// The mint account of the NFT.
779    pub mint: &'b solana_program::account_info::AccountInfo<'a>,
780    /// The Token Metadata metadata account of the NFT.
781    pub metadata: &'b solana_program::account_info::AccountInfo<'a>,
782    /// The Token Metadata edition account of the NFT.
783    pub edition: &'b solana_program::account_info::AccountInfo<'a>,
784    /// The Token Metadata source token record account of the NFT.
785    pub user_token_record: Option<&'b solana_program::account_info::AccountInfo<'a>>,
786    /// The Token Metadata token record for the destination.
787    pub pool_token_record: Option<&'b solana_program::account_info::AccountInfo<'a>>,
788    /// The Token Metadata program account.
789    pub token_metadata_program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
790    /// The sysvar instructions account.
791    pub sysvar_instructions: Option<&'b solana_program::account_info::AccountInfo<'a>>,
792    /// The Metaplex Token Authority Rules account that stores royalty enforcement rules.
793    pub authorization_rules: Option<&'b solana_program::account_info::AccountInfo<'a>>,
794    /// The Metaplex Token Authority Rules program account.
795    pub authorization_rules_program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
796    /// The token account of the NFT for the seller's wallet.
797    pub taker_ta: &'b solana_program::account_info::AccountInfo<'a>,
798    /// The TA of the owner, where the NFT will be transferred to as a result of this sale.
799    pub owner_ta: &'b solana_program::account_info::AccountInfo<'a>,
800    /// The TA of the pool, where the NFT token is temporarily escrowed as a result of this sale.
801    pub pool_ta: &'b solana_program::account_info::AccountInfo<'a>,
802    /// The Token Metadata owner/buyer token record account of the NFT.
803    pub owner_token_record: Option<&'b solana_program::account_info::AccountInfo<'a>>,
804    /// Either the legacy token program or token-2022.
805    pub token_program: &'b solana_program::account_info::AccountInfo<'a>,
806    /// The SPL associated token program.
807    pub associated_token_program: &'b solana_program::account_info::AccountInfo<'a>,
808    /// The Solana system program.
809    pub system_program: &'b solana_program::account_info::AccountInfo<'a>,
810}
811
812/// `sell_nft_token_pool` CPI instruction.
813pub struct SellNftTokenPoolCpi<'a, 'b> {
814    /// The program to invoke.
815    pub __program: &'b solana_program::account_info::AccountInfo<'a>,
816    /// The owner of the pool and the buyer/recipient of the NFT.
817    pub owner: &'b solana_program::account_info::AccountInfo<'a>,
818    /// The taker is the user buying or selling the NFT.
819    pub taker: &'b solana_program::account_info::AccountInfo<'a>,
820    /// The original rent payer of the pool--stored on the pool. Used to refund rent in case the pool
821    /// is auto-closed.
822    pub rent_payer: &'b solana_program::account_info::AccountInfo<'a>,
823    /// Fee vault account owned by the TFEE program.
824    pub fee_vault: &'b solana_program::account_info::AccountInfo<'a>,
825    /// The Pool state account that the NFT is being sold into. Stores pool state and config,
826    /// but is also the owner of any NFTs in the pool, and also escrows any SOL.
827    /// Any active pool can be specified provided it is a Token type and the NFT passes at least one
828    /// whitelist condition.
829    pub pool: &'b solana_program::account_info::AccountInfo<'a>,
830    /// The whitelist account that the pool uses to verify the NFTs being sold into it.
831    pub whitelist: &'b solana_program::account_info::AccountInfo<'a>,
832    /// Optional account which must be passed in if the NFT must be verified against a
833    /// merkle proof condition in the whitelist.
834    pub mint_proof: Option<&'b solana_program::account_info::AccountInfo<'a>>,
835    /// The shared escrow account for pools that have liquidity in a shared account.
836    pub shared_escrow: Option<&'b solana_program::account_info::AccountInfo<'a>>,
837    /// The account that receives the maker broker fee.
838    pub maker_broker: Option<&'b solana_program::account_info::AccountInfo<'a>>,
839    /// The account that receives the taker broker fee.
840    pub taker_broker: Option<&'b solana_program::account_info::AccountInfo<'a>>,
841    /// The optional cosigner account that must be passed in if the pool has a cosigner.
842    pub cosigner: Option<&'b solana_program::account_info::AccountInfo<'a>>,
843    /// The AMM program account, used for self-cpi logging.
844    pub amm_program: &'b solana_program::account_info::AccountInfo<'a>,
845    /// The escrow program account for shared liquidity pools.
846    pub escrow_program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
847
848    pub native_program: &'b solana_program::account_info::AccountInfo<'a>,
849    /// The mint account of the NFT.
850    pub mint: &'b solana_program::account_info::AccountInfo<'a>,
851    /// The Token Metadata metadata account of the NFT.
852    pub metadata: &'b solana_program::account_info::AccountInfo<'a>,
853    /// The Token Metadata edition account of the NFT.
854    pub edition: &'b solana_program::account_info::AccountInfo<'a>,
855    /// The Token Metadata source token record account of the NFT.
856    pub user_token_record: Option<&'b solana_program::account_info::AccountInfo<'a>>,
857    /// The Token Metadata token record for the destination.
858    pub pool_token_record: Option<&'b solana_program::account_info::AccountInfo<'a>>,
859    /// The Token Metadata program account.
860    pub token_metadata_program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
861    /// The sysvar instructions account.
862    pub sysvar_instructions: Option<&'b solana_program::account_info::AccountInfo<'a>>,
863    /// The Metaplex Token Authority Rules account that stores royalty enforcement rules.
864    pub authorization_rules: Option<&'b solana_program::account_info::AccountInfo<'a>>,
865    /// The Metaplex Token Authority Rules program account.
866    pub authorization_rules_program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
867    /// The token account of the NFT for the seller's wallet.
868    pub taker_ta: &'b solana_program::account_info::AccountInfo<'a>,
869    /// The TA of the owner, where the NFT will be transferred to as a result of this sale.
870    pub owner_ta: &'b solana_program::account_info::AccountInfo<'a>,
871    /// The TA of the pool, where the NFT token is temporarily escrowed as a result of this sale.
872    pub pool_ta: &'b solana_program::account_info::AccountInfo<'a>,
873    /// The Token Metadata owner/buyer token record account of the NFT.
874    pub owner_token_record: Option<&'b solana_program::account_info::AccountInfo<'a>>,
875    /// Either the legacy token program or token-2022.
876    pub token_program: &'b solana_program::account_info::AccountInfo<'a>,
877    /// The SPL associated token program.
878    pub associated_token_program: &'b solana_program::account_info::AccountInfo<'a>,
879    /// The Solana system program.
880    pub system_program: &'b solana_program::account_info::AccountInfo<'a>,
881    /// The arguments for the instruction.
882    pub __args: SellNftTokenPoolInstructionArgs,
883}
884
885impl<'a, 'b> SellNftTokenPoolCpi<'a, 'b> {
886    pub fn new(
887        program: &'b solana_program::account_info::AccountInfo<'a>,
888        accounts: SellNftTokenPoolCpiAccounts<'a, 'b>,
889        args: SellNftTokenPoolInstructionArgs,
890    ) -> Self {
891        Self {
892            __program: program,
893            owner: accounts.owner,
894            taker: accounts.taker,
895            rent_payer: accounts.rent_payer,
896            fee_vault: accounts.fee_vault,
897            pool: accounts.pool,
898            whitelist: accounts.whitelist,
899            mint_proof: accounts.mint_proof,
900            shared_escrow: accounts.shared_escrow,
901            maker_broker: accounts.maker_broker,
902            taker_broker: accounts.taker_broker,
903            cosigner: accounts.cosigner,
904            amm_program: accounts.amm_program,
905            escrow_program: accounts.escrow_program,
906            native_program: accounts.native_program,
907            mint: accounts.mint,
908            metadata: accounts.metadata,
909            edition: accounts.edition,
910            user_token_record: accounts.user_token_record,
911            pool_token_record: accounts.pool_token_record,
912            token_metadata_program: accounts.token_metadata_program,
913            sysvar_instructions: accounts.sysvar_instructions,
914            authorization_rules: accounts.authorization_rules,
915            authorization_rules_program: accounts.authorization_rules_program,
916            taker_ta: accounts.taker_ta,
917            owner_ta: accounts.owner_ta,
918            pool_ta: accounts.pool_ta,
919            owner_token_record: accounts.owner_token_record,
920            token_program: accounts.token_program,
921            associated_token_program: accounts.associated_token_program,
922            system_program: accounts.system_program,
923            __args: args,
924        }
925    }
926    #[inline(always)]
927    pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult {
928        self.invoke_signed_with_remaining_accounts(&[], &[])
929    }
930    #[inline(always)]
931    pub fn invoke_with_remaining_accounts(
932        &self,
933        remaining_accounts: &[(
934            &'b solana_program::account_info::AccountInfo<'a>,
935            bool,
936            bool,
937        )],
938    ) -> solana_program::entrypoint::ProgramResult {
939        self.invoke_signed_with_remaining_accounts(&[], remaining_accounts)
940    }
941    #[inline(always)]
942    pub fn invoke_signed(
943        &self,
944        signers_seeds: &[&[&[u8]]],
945    ) -> solana_program::entrypoint::ProgramResult {
946        self.invoke_signed_with_remaining_accounts(signers_seeds, &[])
947    }
948    #[allow(clippy::clone_on_copy)]
949    #[allow(clippy::vec_init_then_push)]
950    pub fn invoke_signed_with_remaining_accounts(
951        &self,
952        signers_seeds: &[&[&[u8]]],
953        remaining_accounts: &[(
954            &'b solana_program::account_info::AccountInfo<'a>,
955            bool,
956            bool,
957        )],
958    ) -> solana_program::entrypoint::ProgramResult {
959        let mut accounts = Vec::with_capacity(30 + remaining_accounts.len());
960        accounts.push(solana_program::instruction::AccountMeta::new(
961            *self.owner.key,
962            false,
963        ));
964        accounts.push(solana_program::instruction::AccountMeta::new(
965            *self.taker.key,
966            true,
967        ));
968        accounts.push(solana_program::instruction::AccountMeta::new(
969            *self.rent_payer.key,
970            false,
971        ));
972        accounts.push(solana_program::instruction::AccountMeta::new(
973            *self.fee_vault.key,
974            false,
975        ));
976        accounts.push(solana_program::instruction::AccountMeta::new(
977            *self.pool.key,
978            false,
979        ));
980        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
981            *self.whitelist.key,
982            false,
983        ));
984        if let Some(mint_proof) = self.mint_proof {
985            accounts.push(solana_program::instruction::AccountMeta::new_readonly(
986                *mint_proof.key,
987                false,
988            ));
989        } else {
990            accounts.push(solana_program::instruction::AccountMeta::new_readonly(
991                crate::TENSOR_AMM_ID,
992                false,
993            ));
994        }
995        if let Some(shared_escrow) = self.shared_escrow {
996            accounts.push(solana_program::instruction::AccountMeta::new(
997                *shared_escrow.key,
998                false,
999            ));
1000        } else {
1001            accounts.push(solana_program::instruction::AccountMeta::new_readonly(
1002                crate::TENSOR_AMM_ID,
1003                false,
1004            ));
1005        }
1006        if let Some(maker_broker) = self.maker_broker {
1007            accounts.push(solana_program::instruction::AccountMeta::new(
1008                *maker_broker.key,
1009                false,
1010            ));
1011        } else {
1012            accounts.push(solana_program::instruction::AccountMeta::new_readonly(
1013                crate::TENSOR_AMM_ID,
1014                false,
1015            ));
1016        }
1017        if let Some(taker_broker) = self.taker_broker {
1018            accounts.push(solana_program::instruction::AccountMeta::new(
1019                *taker_broker.key,
1020                false,
1021            ));
1022        } else {
1023            accounts.push(solana_program::instruction::AccountMeta::new_readonly(
1024                crate::TENSOR_AMM_ID,
1025                false,
1026            ));
1027        }
1028        if let Some(cosigner) = self.cosigner {
1029            accounts.push(solana_program::instruction::AccountMeta::new_readonly(
1030                *cosigner.key,
1031                true,
1032            ));
1033        } else {
1034            accounts.push(solana_program::instruction::AccountMeta::new_readonly(
1035                crate::TENSOR_AMM_ID,
1036                false,
1037            ));
1038        }
1039        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
1040            *self.amm_program.key,
1041            false,
1042        ));
1043        if let Some(escrow_program) = self.escrow_program {
1044            accounts.push(solana_program::instruction::AccountMeta::new_readonly(
1045                *escrow_program.key,
1046                false,
1047            ));
1048        } else {
1049            accounts.push(solana_program::instruction::AccountMeta::new_readonly(
1050                crate::TENSOR_AMM_ID,
1051                false,
1052            ));
1053        }
1054        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
1055            *self.native_program.key,
1056            false,
1057        ));
1058        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
1059            *self.mint.key,
1060            false,
1061        ));
1062        accounts.push(solana_program::instruction::AccountMeta::new(
1063            *self.metadata.key,
1064            false,
1065        ));
1066        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
1067            *self.edition.key,
1068            false,
1069        ));
1070        if let Some(user_token_record) = self.user_token_record {
1071            accounts.push(solana_program::instruction::AccountMeta::new(
1072                *user_token_record.key,
1073                false,
1074            ));
1075        } else {
1076            accounts.push(solana_program::instruction::AccountMeta::new_readonly(
1077                crate::TENSOR_AMM_ID,
1078                false,
1079            ));
1080        }
1081        if let Some(pool_token_record) = self.pool_token_record {
1082            accounts.push(solana_program::instruction::AccountMeta::new(
1083                *pool_token_record.key,
1084                false,
1085            ));
1086        } else {
1087            accounts.push(solana_program::instruction::AccountMeta::new_readonly(
1088                crate::TENSOR_AMM_ID,
1089                false,
1090            ));
1091        }
1092        if let Some(token_metadata_program) = self.token_metadata_program {
1093            accounts.push(solana_program::instruction::AccountMeta::new_readonly(
1094                *token_metadata_program.key,
1095                false,
1096            ));
1097        } else {
1098            accounts.push(solana_program::instruction::AccountMeta::new_readonly(
1099                crate::TENSOR_AMM_ID,
1100                false,
1101            ));
1102        }
1103        if let Some(sysvar_instructions) = self.sysvar_instructions {
1104            accounts.push(solana_program::instruction::AccountMeta::new_readonly(
1105                *sysvar_instructions.key,
1106                false,
1107            ));
1108        } else {
1109            accounts.push(solana_program::instruction::AccountMeta::new_readonly(
1110                crate::TENSOR_AMM_ID,
1111                false,
1112            ));
1113        }
1114        if let Some(authorization_rules) = self.authorization_rules {
1115            accounts.push(solana_program::instruction::AccountMeta::new_readonly(
1116                *authorization_rules.key,
1117                false,
1118            ));
1119        } else {
1120            accounts.push(solana_program::instruction::AccountMeta::new_readonly(
1121                crate::TENSOR_AMM_ID,
1122                false,
1123            ));
1124        }
1125        if let Some(authorization_rules_program) = self.authorization_rules_program {
1126            accounts.push(solana_program::instruction::AccountMeta::new_readonly(
1127                *authorization_rules_program.key,
1128                false,
1129            ));
1130        } else {
1131            accounts.push(solana_program::instruction::AccountMeta::new_readonly(
1132                crate::TENSOR_AMM_ID,
1133                false,
1134            ));
1135        }
1136        accounts.push(solana_program::instruction::AccountMeta::new(
1137            *self.taker_ta.key,
1138            false,
1139        ));
1140        accounts.push(solana_program::instruction::AccountMeta::new(
1141            *self.owner_ta.key,
1142            false,
1143        ));
1144        accounts.push(solana_program::instruction::AccountMeta::new(
1145            *self.pool_ta.key,
1146            false,
1147        ));
1148        if let Some(owner_token_record) = self.owner_token_record {
1149            accounts.push(solana_program::instruction::AccountMeta::new(
1150                *owner_token_record.key,
1151                false,
1152            ));
1153        } else {
1154            accounts.push(solana_program::instruction::AccountMeta::new_readonly(
1155                crate::TENSOR_AMM_ID,
1156                false,
1157            ));
1158        }
1159        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
1160            *self.token_program.key,
1161            false,
1162        ));
1163        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
1164            *self.associated_token_program.key,
1165            false,
1166        ));
1167        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
1168            *self.system_program.key,
1169            false,
1170        ));
1171        remaining_accounts.iter().for_each(|remaining_account| {
1172            accounts.push(solana_program::instruction::AccountMeta {
1173                pubkey: *remaining_account.0.key,
1174                is_signer: remaining_account.1,
1175                is_writable: remaining_account.2,
1176            })
1177        });
1178        let mut data = SellNftTokenPoolInstructionData::new().try_to_vec().unwrap();
1179        let mut args = self.__args.try_to_vec().unwrap();
1180        data.append(&mut args);
1181
1182        let instruction = solana_program::instruction::Instruction {
1183            program_id: crate::TENSOR_AMM_ID,
1184            accounts,
1185            data,
1186        };
1187        let mut account_infos = Vec::with_capacity(31 + remaining_accounts.len());
1188        account_infos.push(self.__program.clone());
1189        account_infos.push(self.owner.clone());
1190        account_infos.push(self.taker.clone());
1191        account_infos.push(self.rent_payer.clone());
1192        account_infos.push(self.fee_vault.clone());
1193        account_infos.push(self.pool.clone());
1194        account_infos.push(self.whitelist.clone());
1195        if let Some(mint_proof) = self.mint_proof {
1196            account_infos.push(mint_proof.clone());
1197        }
1198        if let Some(shared_escrow) = self.shared_escrow {
1199            account_infos.push(shared_escrow.clone());
1200        }
1201        if let Some(maker_broker) = self.maker_broker {
1202            account_infos.push(maker_broker.clone());
1203        }
1204        if let Some(taker_broker) = self.taker_broker {
1205            account_infos.push(taker_broker.clone());
1206        }
1207        if let Some(cosigner) = self.cosigner {
1208            account_infos.push(cosigner.clone());
1209        }
1210        account_infos.push(self.amm_program.clone());
1211        if let Some(escrow_program) = self.escrow_program {
1212            account_infos.push(escrow_program.clone());
1213        }
1214        account_infos.push(self.native_program.clone());
1215        account_infos.push(self.mint.clone());
1216        account_infos.push(self.metadata.clone());
1217        account_infos.push(self.edition.clone());
1218        if let Some(user_token_record) = self.user_token_record {
1219            account_infos.push(user_token_record.clone());
1220        }
1221        if let Some(pool_token_record) = self.pool_token_record {
1222            account_infos.push(pool_token_record.clone());
1223        }
1224        if let Some(token_metadata_program) = self.token_metadata_program {
1225            account_infos.push(token_metadata_program.clone());
1226        }
1227        if let Some(sysvar_instructions) = self.sysvar_instructions {
1228            account_infos.push(sysvar_instructions.clone());
1229        }
1230        if let Some(authorization_rules) = self.authorization_rules {
1231            account_infos.push(authorization_rules.clone());
1232        }
1233        if let Some(authorization_rules_program) = self.authorization_rules_program {
1234            account_infos.push(authorization_rules_program.clone());
1235        }
1236        account_infos.push(self.taker_ta.clone());
1237        account_infos.push(self.owner_ta.clone());
1238        account_infos.push(self.pool_ta.clone());
1239        if let Some(owner_token_record) = self.owner_token_record {
1240            account_infos.push(owner_token_record.clone());
1241        }
1242        account_infos.push(self.token_program.clone());
1243        account_infos.push(self.associated_token_program.clone());
1244        account_infos.push(self.system_program.clone());
1245        remaining_accounts
1246            .iter()
1247            .for_each(|remaining_account| account_infos.push(remaining_account.0.clone()));
1248
1249        if signers_seeds.is_empty() {
1250            solana_program::program::invoke(&instruction, &account_infos)
1251        } else {
1252            solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds)
1253        }
1254    }
1255}
1256
1257/// Instruction builder for `SellNftTokenPool` via CPI.
1258///
1259/// ### Accounts:
1260///
1261///   0. `[writable]` owner
1262///   1. `[writable, signer]` taker
1263///   2. `[writable]` rent_payer
1264///   3. `[writable]` fee_vault
1265///   4. `[writable]` pool
1266///   5. `[]` whitelist
1267///   6. `[optional]` mint_proof
1268///   7. `[writable, optional]` shared_escrow
1269///   8. `[writable, optional]` maker_broker
1270///   9. `[writable, optional]` taker_broker
1271///   10. `[signer, optional]` cosigner
1272///   11. `[]` amm_program
1273///   12. `[optional]` escrow_program
1274///   13. `[]` native_program
1275///   14. `[]` mint
1276///   15. `[writable]` metadata
1277///   16. `[]` edition
1278///   17. `[writable, optional]` user_token_record
1279///   18. `[writable, optional]` pool_token_record
1280///   19. `[optional]` token_metadata_program
1281///   20. `[optional]` sysvar_instructions
1282///   21. `[optional]` authorization_rules
1283///   22. `[optional]` authorization_rules_program
1284///   23. `[writable]` taker_ta
1285///   24. `[writable]` owner_ta
1286///   25. `[writable]` pool_ta
1287///   26. `[writable, optional]` owner_token_record
1288///   27. `[]` token_program
1289///   28. `[]` associated_token_program
1290///   29. `[]` system_program
1291#[derive(Clone, Debug)]
1292pub struct SellNftTokenPoolCpiBuilder<'a, 'b> {
1293    instruction: Box<SellNftTokenPoolCpiBuilderInstruction<'a, 'b>>,
1294}
1295
1296impl<'a, 'b> SellNftTokenPoolCpiBuilder<'a, 'b> {
1297    pub fn new(program: &'b solana_program::account_info::AccountInfo<'a>) -> Self {
1298        let instruction = Box::new(SellNftTokenPoolCpiBuilderInstruction {
1299            __program: program,
1300            owner: None,
1301            taker: None,
1302            rent_payer: None,
1303            fee_vault: None,
1304            pool: None,
1305            whitelist: None,
1306            mint_proof: None,
1307            shared_escrow: None,
1308            maker_broker: None,
1309            taker_broker: None,
1310            cosigner: None,
1311            amm_program: None,
1312            escrow_program: None,
1313            native_program: None,
1314            mint: None,
1315            metadata: None,
1316            edition: None,
1317            user_token_record: None,
1318            pool_token_record: None,
1319            token_metadata_program: None,
1320            sysvar_instructions: None,
1321            authorization_rules: None,
1322            authorization_rules_program: None,
1323            taker_ta: None,
1324            owner_ta: None,
1325            pool_ta: None,
1326            owner_token_record: None,
1327            token_program: None,
1328            associated_token_program: None,
1329            system_program: None,
1330            min_price: None,
1331            authorization_data: None,
1332            optional_royalty_pct: None,
1333            __remaining_accounts: Vec::new(),
1334        });
1335        Self { instruction }
1336    }
1337    /// The owner of the pool and the buyer/recipient of the NFT.
1338    #[inline(always)]
1339    pub fn owner(&mut self, owner: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self {
1340        self.instruction.owner = Some(owner);
1341        self
1342    }
1343    /// The taker is the user buying or selling the NFT.
1344    #[inline(always)]
1345    pub fn taker(&mut self, taker: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self {
1346        self.instruction.taker = Some(taker);
1347        self
1348    }
1349    /// The original rent payer of the pool--stored on the pool. Used to refund rent in case the pool
1350    /// is auto-closed.
1351    #[inline(always)]
1352    pub fn rent_payer(
1353        &mut self,
1354        rent_payer: &'b solana_program::account_info::AccountInfo<'a>,
1355    ) -> &mut Self {
1356        self.instruction.rent_payer = Some(rent_payer);
1357        self
1358    }
1359    /// Fee vault account owned by the TFEE program.
1360    #[inline(always)]
1361    pub fn fee_vault(
1362        &mut self,
1363        fee_vault: &'b solana_program::account_info::AccountInfo<'a>,
1364    ) -> &mut Self {
1365        self.instruction.fee_vault = Some(fee_vault);
1366        self
1367    }
1368    /// The Pool state account that the NFT is being sold into. Stores pool state and config,
1369    /// but is also the owner of any NFTs in the pool, and also escrows any SOL.
1370    /// Any active pool can be specified provided it is a Token type and the NFT passes at least one
1371    /// whitelist condition.
1372    #[inline(always)]
1373    pub fn pool(&mut self, pool: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self {
1374        self.instruction.pool = Some(pool);
1375        self
1376    }
1377    /// The whitelist account that the pool uses to verify the NFTs being sold into it.
1378    #[inline(always)]
1379    pub fn whitelist(
1380        &mut self,
1381        whitelist: &'b solana_program::account_info::AccountInfo<'a>,
1382    ) -> &mut Self {
1383        self.instruction.whitelist = Some(whitelist);
1384        self
1385    }
1386    /// `[optional account]`
1387    /// Optional account which must be passed in if the NFT must be verified against a
1388    /// merkle proof condition in the whitelist.
1389    #[inline(always)]
1390    pub fn mint_proof(
1391        &mut self,
1392        mint_proof: Option<&'b solana_program::account_info::AccountInfo<'a>>,
1393    ) -> &mut Self {
1394        self.instruction.mint_proof = mint_proof;
1395        self
1396    }
1397    /// `[optional account]`
1398    /// The shared escrow account for pools that have liquidity in a shared account.
1399    #[inline(always)]
1400    pub fn shared_escrow(
1401        &mut self,
1402        shared_escrow: Option<&'b solana_program::account_info::AccountInfo<'a>>,
1403    ) -> &mut Self {
1404        self.instruction.shared_escrow = shared_escrow;
1405        self
1406    }
1407    /// `[optional account]`
1408    /// The account that receives the maker broker fee.
1409    #[inline(always)]
1410    pub fn maker_broker(
1411        &mut self,
1412        maker_broker: Option<&'b solana_program::account_info::AccountInfo<'a>>,
1413    ) -> &mut Self {
1414        self.instruction.maker_broker = maker_broker;
1415        self
1416    }
1417    /// `[optional account]`
1418    /// The account that receives the taker broker fee.
1419    #[inline(always)]
1420    pub fn taker_broker(
1421        &mut self,
1422        taker_broker: Option<&'b solana_program::account_info::AccountInfo<'a>>,
1423    ) -> &mut Self {
1424        self.instruction.taker_broker = taker_broker;
1425        self
1426    }
1427    /// `[optional account]`
1428    /// The optional cosigner account that must be passed in if the pool has a cosigner.
1429    #[inline(always)]
1430    pub fn cosigner(
1431        &mut self,
1432        cosigner: Option<&'b solana_program::account_info::AccountInfo<'a>>,
1433    ) -> &mut Self {
1434        self.instruction.cosigner = cosigner;
1435        self
1436    }
1437    /// The AMM program account, used for self-cpi logging.
1438    #[inline(always)]
1439    pub fn amm_program(
1440        &mut self,
1441        amm_program: &'b solana_program::account_info::AccountInfo<'a>,
1442    ) -> &mut Self {
1443        self.instruction.amm_program = Some(amm_program);
1444        self
1445    }
1446    /// `[optional account]`
1447    /// The escrow program account for shared liquidity pools.
1448    #[inline(always)]
1449    pub fn escrow_program(
1450        &mut self,
1451        escrow_program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
1452    ) -> &mut Self {
1453        self.instruction.escrow_program = escrow_program;
1454        self
1455    }
1456    #[inline(always)]
1457    pub fn native_program(
1458        &mut self,
1459        native_program: &'b solana_program::account_info::AccountInfo<'a>,
1460    ) -> &mut Self {
1461        self.instruction.native_program = Some(native_program);
1462        self
1463    }
1464    /// The mint account of the NFT.
1465    #[inline(always)]
1466    pub fn mint(&mut self, mint: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self {
1467        self.instruction.mint = Some(mint);
1468        self
1469    }
1470    /// The Token Metadata metadata account of the NFT.
1471    #[inline(always)]
1472    pub fn metadata(
1473        &mut self,
1474        metadata: &'b solana_program::account_info::AccountInfo<'a>,
1475    ) -> &mut Self {
1476        self.instruction.metadata = Some(metadata);
1477        self
1478    }
1479    /// The Token Metadata edition account of the NFT.
1480    #[inline(always)]
1481    pub fn edition(
1482        &mut self,
1483        edition: &'b solana_program::account_info::AccountInfo<'a>,
1484    ) -> &mut Self {
1485        self.instruction.edition = Some(edition);
1486        self
1487    }
1488    /// `[optional account]`
1489    /// The Token Metadata source token record account of the NFT.
1490    #[inline(always)]
1491    pub fn user_token_record(
1492        &mut self,
1493        user_token_record: Option<&'b solana_program::account_info::AccountInfo<'a>>,
1494    ) -> &mut Self {
1495        self.instruction.user_token_record = user_token_record;
1496        self
1497    }
1498    /// `[optional account]`
1499    /// The Token Metadata token record for the destination.
1500    #[inline(always)]
1501    pub fn pool_token_record(
1502        &mut self,
1503        pool_token_record: Option<&'b solana_program::account_info::AccountInfo<'a>>,
1504    ) -> &mut Self {
1505        self.instruction.pool_token_record = pool_token_record;
1506        self
1507    }
1508    /// `[optional account]`
1509    /// The Token Metadata program account.
1510    #[inline(always)]
1511    pub fn token_metadata_program(
1512        &mut self,
1513        token_metadata_program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
1514    ) -> &mut Self {
1515        self.instruction.token_metadata_program = token_metadata_program;
1516        self
1517    }
1518    /// `[optional account]`
1519    /// The sysvar instructions account.
1520    #[inline(always)]
1521    pub fn sysvar_instructions(
1522        &mut self,
1523        sysvar_instructions: Option<&'b solana_program::account_info::AccountInfo<'a>>,
1524    ) -> &mut Self {
1525        self.instruction.sysvar_instructions = sysvar_instructions;
1526        self
1527    }
1528    /// `[optional account]`
1529    /// The Metaplex Token Authority Rules account that stores royalty enforcement rules.
1530    #[inline(always)]
1531    pub fn authorization_rules(
1532        &mut self,
1533        authorization_rules: Option<&'b solana_program::account_info::AccountInfo<'a>>,
1534    ) -> &mut Self {
1535        self.instruction.authorization_rules = authorization_rules;
1536        self
1537    }
1538    /// `[optional account]`
1539    /// The Metaplex Token Authority Rules program account.
1540    #[inline(always)]
1541    pub fn authorization_rules_program(
1542        &mut self,
1543        authorization_rules_program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
1544    ) -> &mut Self {
1545        self.instruction.authorization_rules_program = authorization_rules_program;
1546        self
1547    }
1548    /// The token account of the NFT for the seller's wallet.
1549    #[inline(always)]
1550    pub fn taker_ta(
1551        &mut self,
1552        taker_ta: &'b solana_program::account_info::AccountInfo<'a>,
1553    ) -> &mut Self {
1554        self.instruction.taker_ta = Some(taker_ta);
1555        self
1556    }
1557    /// The TA of the owner, where the NFT will be transferred to as a result of this sale.
1558    #[inline(always)]
1559    pub fn owner_ta(
1560        &mut self,
1561        owner_ta: &'b solana_program::account_info::AccountInfo<'a>,
1562    ) -> &mut Self {
1563        self.instruction.owner_ta = Some(owner_ta);
1564        self
1565    }
1566    /// The TA of the pool, where the NFT token is temporarily escrowed as a result of this sale.
1567    #[inline(always)]
1568    pub fn pool_ta(
1569        &mut self,
1570        pool_ta: &'b solana_program::account_info::AccountInfo<'a>,
1571    ) -> &mut Self {
1572        self.instruction.pool_ta = Some(pool_ta);
1573        self
1574    }
1575    /// `[optional account]`
1576    /// The Token Metadata owner/buyer token record account of the NFT.
1577    #[inline(always)]
1578    pub fn owner_token_record(
1579        &mut self,
1580        owner_token_record: Option<&'b solana_program::account_info::AccountInfo<'a>>,
1581    ) -> &mut Self {
1582        self.instruction.owner_token_record = owner_token_record;
1583        self
1584    }
1585    /// Either the legacy token program or token-2022.
1586    #[inline(always)]
1587    pub fn token_program(
1588        &mut self,
1589        token_program: &'b solana_program::account_info::AccountInfo<'a>,
1590    ) -> &mut Self {
1591        self.instruction.token_program = Some(token_program);
1592        self
1593    }
1594    /// The SPL associated token program.
1595    #[inline(always)]
1596    pub fn associated_token_program(
1597        &mut self,
1598        associated_token_program: &'b solana_program::account_info::AccountInfo<'a>,
1599    ) -> &mut Self {
1600        self.instruction.associated_token_program = Some(associated_token_program);
1601        self
1602    }
1603    /// The Solana system program.
1604    #[inline(always)]
1605    pub fn system_program(
1606        &mut self,
1607        system_program: &'b solana_program::account_info::AccountInfo<'a>,
1608    ) -> &mut Self {
1609        self.instruction.system_program = Some(system_program);
1610        self
1611    }
1612    #[inline(always)]
1613    pub fn min_price(&mut self, min_price: u64) -> &mut Self {
1614        self.instruction.min_price = Some(min_price);
1615        self
1616    }
1617    /// `[optional argument]`
1618    #[inline(always)]
1619    pub fn authorization_data(&mut self, authorization_data: AuthorizationDataLocal) -> &mut Self {
1620        self.instruction.authorization_data = Some(authorization_data);
1621        self
1622    }
1623    /// `[optional argument]`
1624    #[inline(always)]
1625    pub fn optional_royalty_pct(&mut self, optional_royalty_pct: u16) -> &mut Self {
1626        self.instruction.optional_royalty_pct = Some(optional_royalty_pct);
1627        self
1628    }
1629    /// Add an additional account to the instruction.
1630    #[inline(always)]
1631    pub fn add_remaining_account(
1632        &mut self,
1633        account: &'b solana_program::account_info::AccountInfo<'a>,
1634        is_writable: bool,
1635        is_signer: bool,
1636    ) -> &mut Self {
1637        self.instruction
1638            .__remaining_accounts
1639            .push((account, is_writable, is_signer));
1640        self
1641    }
1642    /// Add additional accounts to the instruction.
1643    ///
1644    /// Each account is represented by a tuple of the `AccountInfo`, a `bool` indicating whether the account is writable or not,
1645    /// and a `bool` indicating whether the account is a signer or not.
1646    #[inline(always)]
1647    pub fn add_remaining_accounts(
1648        &mut self,
1649        accounts: &[(
1650            &'b solana_program::account_info::AccountInfo<'a>,
1651            bool,
1652            bool,
1653        )],
1654    ) -> &mut Self {
1655        self.instruction
1656            .__remaining_accounts
1657            .extend_from_slice(accounts);
1658        self
1659    }
1660    #[inline(always)]
1661    pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult {
1662        self.invoke_signed(&[])
1663    }
1664    #[allow(clippy::clone_on_copy)]
1665    #[allow(clippy::vec_init_then_push)]
1666    pub fn invoke_signed(
1667        &self,
1668        signers_seeds: &[&[&[u8]]],
1669    ) -> solana_program::entrypoint::ProgramResult {
1670        let args = SellNftTokenPoolInstructionArgs {
1671            min_price: self
1672                .instruction
1673                .min_price
1674                .clone()
1675                .expect("min_price is not set"),
1676            authorization_data: self.instruction.authorization_data.clone(),
1677            optional_royalty_pct: self.instruction.optional_royalty_pct.clone(),
1678        };
1679        let instruction = SellNftTokenPoolCpi {
1680            __program: self.instruction.__program,
1681
1682            owner: self.instruction.owner.expect("owner is not set"),
1683
1684            taker: self.instruction.taker.expect("taker is not set"),
1685
1686            rent_payer: self.instruction.rent_payer.expect("rent_payer is not set"),
1687
1688            fee_vault: self.instruction.fee_vault.expect("fee_vault is not set"),
1689
1690            pool: self.instruction.pool.expect("pool is not set"),
1691
1692            whitelist: self.instruction.whitelist.expect("whitelist is not set"),
1693
1694            mint_proof: self.instruction.mint_proof,
1695
1696            shared_escrow: self.instruction.shared_escrow,
1697
1698            maker_broker: self.instruction.maker_broker,
1699
1700            taker_broker: self.instruction.taker_broker,
1701
1702            cosigner: self.instruction.cosigner,
1703
1704            amm_program: self
1705                .instruction
1706                .amm_program
1707                .expect("amm_program is not set"),
1708
1709            escrow_program: self.instruction.escrow_program,
1710
1711            native_program: self
1712                .instruction
1713                .native_program
1714                .expect("native_program is not set"),
1715
1716            mint: self.instruction.mint.expect("mint is not set"),
1717
1718            metadata: self.instruction.metadata.expect("metadata is not set"),
1719
1720            edition: self.instruction.edition.expect("edition is not set"),
1721
1722            user_token_record: self.instruction.user_token_record,
1723
1724            pool_token_record: self.instruction.pool_token_record,
1725
1726            token_metadata_program: self.instruction.token_metadata_program,
1727
1728            sysvar_instructions: self.instruction.sysvar_instructions,
1729
1730            authorization_rules: self.instruction.authorization_rules,
1731
1732            authorization_rules_program: self.instruction.authorization_rules_program,
1733
1734            taker_ta: self.instruction.taker_ta.expect("taker_ta is not set"),
1735
1736            owner_ta: self.instruction.owner_ta.expect("owner_ta is not set"),
1737
1738            pool_ta: self.instruction.pool_ta.expect("pool_ta is not set"),
1739
1740            owner_token_record: self.instruction.owner_token_record,
1741
1742            token_program: self
1743                .instruction
1744                .token_program
1745                .expect("token_program is not set"),
1746
1747            associated_token_program: self
1748                .instruction
1749                .associated_token_program
1750                .expect("associated_token_program is not set"),
1751
1752            system_program: self
1753                .instruction
1754                .system_program
1755                .expect("system_program is not set"),
1756            __args: args,
1757        };
1758        instruction.invoke_signed_with_remaining_accounts(
1759            signers_seeds,
1760            &self.instruction.__remaining_accounts,
1761        )
1762    }
1763}
1764
1765#[derive(Clone, Debug)]
1766struct SellNftTokenPoolCpiBuilderInstruction<'a, 'b> {
1767    __program: &'b solana_program::account_info::AccountInfo<'a>,
1768    owner: Option<&'b solana_program::account_info::AccountInfo<'a>>,
1769    taker: Option<&'b solana_program::account_info::AccountInfo<'a>>,
1770    rent_payer: Option<&'b solana_program::account_info::AccountInfo<'a>>,
1771    fee_vault: Option<&'b solana_program::account_info::AccountInfo<'a>>,
1772    pool: Option<&'b solana_program::account_info::AccountInfo<'a>>,
1773    whitelist: Option<&'b solana_program::account_info::AccountInfo<'a>>,
1774    mint_proof: Option<&'b solana_program::account_info::AccountInfo<'a>>,
1775    shared_escrow: Option<&'b solana_program::account_info::AccountInfo<'a>>,
1776    maker_broker: Option<&'b solana_program::account_info::AccountInfo<'a>>,
1777    taker_broker: Option<&'b solana_program::account_info::AccountInfo<'a>>,
1778    cosigner: Option<&'b solana_program::account_info::AccountInfo<'a>>,
1779    amm_program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
1780    escrow_program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
1781    native_program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
1782    mint: Option<&'b solana_program::account_info::AccountInfo<'a>>,
1783    metadata: Option<&'b solana_program::account_info::AccountInfo<'a>>,
1784    edition: Option<&'b solana_program::account_info::AccountInfo<'a>>,
1785    user_token_record: Option<&'b solana_program::account_info::AccountInfo<'a>>,
1786    pool_token_record: Option<&'b solana_program::account_info::AccountInfo<'a>>,
1787    token_metadata_program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
1788    sysvar_instructions: Option<&'b solana_program::account_info::AccountInfo<'a>>,
1789    authorization_rules: Option<&'b solana_program::account_info::AccountInfo<'a>>,
1790    authorization_rules_program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
1791    taker_ta: Option<&'b solana_program::account_info::AccountInfo<'a>>,
1792    owner_ta: Option<&'b solana_program::account_info::AccountInfo<'a>>,
1793    pool_ta: Option<&'b solana_program::account_info::AccountInfo<'a>>,
1794    owner_token_record: Option<&'b solana_program::account_info::AccountInfo<'a>>,
1795    token_program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
1796    associated_token_program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
1797    system_program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
1798    min_price: Option<u64>,
1799    authorization_data: Option<AuthorizationDataLocal>,
1800    optional_royalty_pct: Option<u16>,
1801    /// Additional instruction accounts `(AccountInfo, is_writable, is_signer)`.
1802    __remaining_accounts: Vec<(
1803        &'b solana_program::account_info::AccountInfo<'a>,
1804        bool,
1805        bool,
1806    )>,
1807}