From e1b3a1a8b0849e6bf2d9476364e3617c8d82569b Mon Sep 17 00:00:00 2001 From: Michael Danenberg <56533526+danenbm@users.noreply.github.com> Date: Fri, 8 Mar 2024 13:06:08 -0800 Subject: [PATCH] Regenerate IDL and clients --- clients/js/src/generated/errors/mplCore.ts | 26 +++++++ .../js/src/generated/instructions/compress.ts | 11 +-- .../src/generated/instructions/decompress.ts | 11 +-- .../js/src/generated/instructions/transfer.ts | 9 ++- clients/rust/src/generated/errors/mpl_core.rs | 6 ++ .../src/generated/instructions/compress.rs | 40 ++++++----- .../src/generated/instructions/decompress.rs | 40 ++++++----- .../src/generated/instructions/transfer.rs | 70 +++++++++++++++++-- idls/mpl_core.json | 23 +++++- 9 files changed, 184 insertions(+), 52 deletions(-) diff --git a/clients/js/src/generated/errors/mplCore.ts b/clients/js/src/generated/errors/mplCore.ts index 6befb4d4..eb898f40 100644 --- a/clients/js/src/generated/errors/mplCore.ts +++ b/clients/js/src/generated/errors/mplCore.ts @@ -304,6 +304,32 @@ export class MissingNewOwnerError extends ProgramError { codeToErrorMap.set(0x15, MissingNewOwnerError); nameToErrorMap.set('MissingNewOwner', MissingNewOwnerError); +/** MissingSystemProgram: Missing system program */ +export class MissingSystemProgramError extends ProgramError { + override readonly name: string = 'MissingSystemProgram'; + + readonly code: number = 0x16; // 22 + + constructor(program: Program, cause?: Error) { + super('Missing system program', program, cause); + } +} +codeToErrorMap.set(0x16, MissingSystemProgramError); +nameToErrorMap.set('MissingSystemProgram', MissingSystemProgramError); + +/** NotImplemented: Not implemented */ +export class NotImplementedError extends ProgramError { + override readonly name: string = 'NotImplemented'; + + readonly code: number = 0x17; // 23 + + constructor(program: Program, cause?: Error) { + super('Not implemented', program, cause); + } +} +codeToErrorMap.set(0x17, NotImplementedError); +nameToErrorMap.set('NotImplemented', NotImplementedError); + /** * Attempts to resolve a custom program error from the provided error code. * @category Errors diff --git a/clients/js/src/generated/instructions/compress.ts b/clients/js/src/generated/instructions/compress.ts index df7e8c1c..eb447f2d 100644 --- a/clients/js/src/generated/instructions/compress.ts +++ b/clients/js/src/generated/instructions/compress.ts @@ -33,7 +33,7 @@ export type CompressInstructionAccounts = { /** The collection to which the asset belongs */ collection?: PublicKey | Pda; /** The owner or delegate of the asset */ - owner: Signer; + authority?: Signer; /** The account receiving the storage fees */ payer?: Signer; /** The system program */ @@ -65,7 +65,7 @@ export function getCompressInstructionDataSerializer(): Serializer< // Instruction. export function compress( - context: Pick, + context: Pick, input: CompressInstructionAccounts ): TransactionBuilder { // Program ID. @@ -86,10 +86,10 @@ export function compress( isWritable: false as boolean, value: input.collection ?? null, }, - owner: { + authority: { index: 2, isWritable: false as boolean, - value: input.owner ?? null, + value: input.authority ?? null, }, payer: { index: 3, @@ -109,6 +109,9 @@ export function compress( } satisfies ResolvedAccountsWithIndices; // Default values. + if (!resolvedAccounts.authority.value) { + resolvedAccounts.authority.value = context.identity; + } if (!resolvedAccounts.systemProgram.value) { resolvedAccounts.systemProgram.value = context.programs.getPublicKey( 'splSystem', diff --git a/clients/js/src/generated/instructions/decompress.ts b/clients/js/src/generated/instructions/decompress.ts index b21078de..a44941d8 100644 --- a/clients/js/src/generated/instructions/decompress.ts +++ b/clients/js/src/generated/instructions/decompress.ts @@ -38,7 +38,7 @@ export type DecompressInstructionAccounts = { /** The collection to which the asset belongs */ collection?: PublicKey | Pda; /** The owner or delegate of the asset */ - owner: Signer; + authority?: Signer; /** The account paying for the storage fees */ payer?: Signer; /** The system program */ @@ -82,7 +82,7 @@ export type DecompressInstructionArgs = DecompressInstructionDataArgs; // Instruction. export function decompress( - context: Pick, + context: Pick, input: DecompressInstructionAccounts & DecompressInstructionArgs ): TransactionBuilder { // Program ID. @@ -103,10 +103,10 @@ export function decompress( isWritable: false as boolean, value: input.collection ?? null, }, - owner: { + authority: { index: 2, isWritable: false as boolean, - value: input.owner ?? null, + value: input.authority ?? null, }, payer: { index: 3, @@ -129,6 +129,9 @@ export function decompress( const resolvedArgs: DecompressInstructionArgs = { ...input }; // Default values. + if (!resolvedAccounts.authority.value) { + resolvedAccounts.authority.value = context.identity; + } if (!resolvedAccounts.systemProgram.value) { resolvedAccounts.systemProgram.value = context.programs.getPublicKey( 'splSystem', diff --git a/clients/js/src/generated/instructions/transfer.ts b/clients/js/src/generated/instructions/transfer.ts index aaffa9ca..1e97a069 100644 --- a/clients/js/src/generated/instructions/transfer.ts +++ b/clients/js/src/generated/instructions/transfer.ts @@ -46,6 +46,8 @@ export type TransferInstructionAccounts = { payer?: Signer; /** The new owner to which to transfer the asset */ newOwner: PublicKey | Pda; + /** The system program */ + systemProgram?: PublicKey | Pda; /** The SPL Noop Program */ logWrapper?: PublicKey | Pda; }; @@ -121,9 +123,14 @@ export function transfer( isWritable: false as boolean, value: input.newOwner ?? null, }, - logWrapper: { + systemProgram: { index: 5, isWritable: false as boolean, + value: input.systemProgram ?? null, + }, + logWrapper: { + index: 6, + isWritable: false as boolean, value: input.logWrapper ?? null, }, } satisfies ResolvedAccountsWithIndices; diff --git a/clients/rust/src/generated/errors/mpl_core.rs b/clients/rust/src/generated/errors/mpl_core.rs index 83a89a41..d512c00b 100644 --- a/clients/rust/src/generated/errors/mpl_core.rs +++ b/clients/rust/src/generated/errors/mpl_core.rs @@ -76,6 +76,12 @@ pub enum MplCoreError { /// 21 (0x15) - Missing new owner #[error("Missing new owner")] MissingNewOwner, + /// 22 (0x16) - Missing system program + #[error("Missing system program")] + MissingSystemProgram, + /// 23 (0x17) - Not implemented + #[error("Not implemented")] + NotImplemented, } impl solana_program::program_error::PrintProgramError for MplCoreError { diff --git a/clients/rust/src/generated/instructions/compress.rs b/clients/rust/src/generated/instructions/compress.rs index 2d3d0ad1..fc49ede1 100644 --- a/clients/rust/src/generated/instructions/compress.rs +++ b/clients/rust/src/generated/instructions/compress.rs @@ -15,7 +15,7 @@ pub struct Compress { /// The collection to which the asset belongs pub collection: Option, /// The owner or delegate of the asset - pub owner: solana_program::pubkey::Pubkey, + pub authority: solana_program::pubkey::Pubkey, /// The account receiving the storage fees pub payer: Option, /// The system program @@ -48,7 +48,8 @@ impl Compress { )); } accounts.push(solana_program::instruction::AccountMeta::new_readonly( - self.owner, true, + self.authority, + true, )); if let Some(payer) = self.payer { accounts.push(solana_program::instruction::AccountMeta::new(payer, true)); @@ -101,7 +102,7 @@ impl CompressInstructionData { /// /// 0. `[writable]` asset /// 1. `[optional]` collection -/// 2. `[signer]` owner +/// 2. `[signer]` authority /// 3. `[writable, signer, optional]` payer /// 4. `[optional]` system_program (default to `11111111111111111111111111111111`) /// 5. `[optional]` log_wrapper @@ -109,7 +110,7 @@ impl CompressInstructionData { pub struct CompressBuilder { asset: Option, collection: Option, - owner: Option, + authority: Option, payer: Option, system_program: Option, log_wrapper: Option, @@ -135,8 +136,8 @@ impl CompressBuilder { } /// The owner or delegate of the asset #[inline(always)] - pub fn owner(&mut self, owner: solana_program::pubkey::Pubkey) -> &mut Self { - self.owner = Some(owner); + pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { + self.authority = Some(authority); self } /// `[optional account]` @@ -186,7 +187,7 @@ impl CompressBuilder { let accounts = Compress { asset: self.asset.expect("asset is not set"), collection: self.collection, - owner: self.owner.expect("owner is not set"), + authority: self.authority.expect("authority is not set"), payer: self.payer, system_program: self .system_program @@ -205,7 +206,7 @@ pub struct CompressCpiAccounts<'a, 'b> { /// The collection to which the asset belongs pub collection: Option<&'b solana_program::account_info::AccountInfo<'a>>, /// The owner or delegate of the asset - pub owner: &'b solana_program::account_info::AccountInfo<'a>, + pub authority: &'b solana_program::account_info::AccountInfo<'a>, /// The account receiving the storage fees pub payer: Option<&'b solana_program::account_info::AccountInfo<'a>>, /// The system program @@ -223,7 +224,7 @@ pub struct CompressCpi<'a, 'b> { /// The collection to which the asset belongs pub collection: Option<&'b solana_program::account_info::AccountInfo<'a>>, /// The owner or delegate of the asset - pub owner: &'b solana_program::account_info::AccountInfo<'a>, + pub authority: &'b solana_program::account_info::AccountInfo<'a>, /// The account receiving the storage fees pub payer: Option<&'b solana_program::account_info::AccountInfo<'a>>, /// The system program @@ -241,7 +242,7 @@ impl<'a, 'b> CompressCpi<'a, 'b> { __program: program, asset: accounts.asset, collection: accounts.collection, - owner: accounts.owner, + authority: accounts.authority, payer: accounts.payer, system_program: accounts.system_program, log_wrapper: accounts.log_wrapper, @@ -297,7 +298,7 @@ impl<'a, 'b> CompressCpi<'a, 'b> { )); } accounts.push(solana_program::instruction::AccountMeta::new_readonly( - *self.owner.key, + *self.authority.key, true, )); if let Some(payer) = self.payer { @@ -345,7 +346,7 @@ impl<'a, 'b> CompressCpi<'a, 'b> { if let Some(collection) = self.collection { account_infos.push(collection.clone()); } - account_infos.push(self.owner.clone()); + account_infos.push(self.authority.clone()); if let Some(payer) = self.payer { account_infos.push(payer.clone()); } @@ -371,7 +372,7 @@ impl<'a, 'b> CompressCpi<'a, 'b> { /// /// 0. `[writable]` asset /// 1. `[optional]` collection -/// 2. `[signer]` owner +/// 2. `[signer]` authority /// 3. `[writable, signer, optional]` payer /// 4. `[]` system_program /// 5. `[optional]` log_wrapper @@ -385,7 +386,7 @@ impl<'a, 'b> CompressCpiBuilder<'a, 'b> { __program: program, asset: None, collection: None, - owner: None, + authority: None, payer: None, system_program: None, log_wrapper: None, @@ -411,8 +412,11 @@ impl<'a, 'b> CompressCpiBuilder<'a, 'b> { } /// The owner or delegate of the asset #[inline(always)] - pub fn owner(&mut self, owner: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self { - self.instruction.owner = Some(owner); + pub fn authority( + &mut self, + authority: &'b solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authority = Some(authority); self } /// `[optional account]` @@ -492,7 +496,7 @@ impl<'a, 'b> CompressCpiBuilder<'a, 'b> { collection: self.instruction.collection, - owner: self.instruction.owner.expect("owner is not set"), + authority: self.instruction.authority.expect("authority is not set"), payer: self.instruction.payer, @@ -514,7 +518,7 @@ struct CompressCpiBuilderInstruction<'a, 'b> { __program: &'b solana_program::account_info::AccountInfo<'a>, asset: Option<&'b solana_program::account_info::AccountInfo<'a>>, collection: Option<&'b solana_program::account_info::AccountInfo<'a>>, - owner: Option<&'b solana_program::account_info::AccountInfo<'a>>, + authority: Option<&'b solana_program::account_info::AccountInfo<'a>>, payer: Option<&'b solana_program::account_info::AccountInfo<'a>>, system_program: Option<&'b solana_program::account_info::AccountInfo<'a>>, log_wrapper: Option<&'b solana_program::account_info::AccountInfo<'a>>, diff --git a/clients/rust/src/generated/instructions/decompress.rs b/clients/rust/src/generated/instructions/decompress.rs index 905efb54..93105efd 100644 --- a/clients/rust/src/generated/instructions/decompress.rs +++ b/clients/rust/src/generated/instructions/decompress.rs @@ -16,7 +16,7 @@ pub struct Decompress { /// The collection to which the asset belongs pub collection: Option, /// The owner or delegate of the asset - pub owner: solana_program::pubkey::Pubkey, + pub authority: solana_program::pubkey::Pubkey, /// The account paying for the storage fees pub payer: Option, /// The system program @@ -53,7 +53,8 @@ impl Decompress { )); } accounts.push(solana_program::instruction::AccountMeta::new_readonly( - self.owner, true, + self.authority, + true, )); if let Some(payer) = self.payer { accounts.push(solana_program::instruction::AccountMeta::new(payer, true)); @@ -114,7 +115,7 @@ pub struct DecompressInstructionArgs { /// /// 0. `[writable]` asset /// 1. `[optional]` collection -/// 2. `[signer]` owner +/// 2. `[signer]` authority /// 3. `[writable, signer, optional]` payer /// 4. `[optional]` system_program (default to `11111111111111111111111111111111`) /// 5. `[optional]` log_wrapper @@ -122,7 +123,7 @@ pub struct DecompressInstructionArgs { pub struct DecompressBuilder { asset: Option, collection: Option, - owner: Option, + authority: Option, payer: Option, system_program: Option, log_wrapper: Option, @@ -149,8 +150,8 @@ impl DecompressBuilder { } /// The owner or delegate of the asset #[inline(always)] - pub fn owner(&mut self, owner: solana_program::pubkey::Pubkey) -> &mut Self { - self.owner = Some(owner); + pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { + self.authority = Some(authority); self } /// `[optional account]` @@ -205,7 +206,7 @@ impl DecompressBuilder { let accounts = Decompress { asset: self.asset.expect("asset is not set"), collection: self.collection, - owner: self.owner.expect("owner is not set"), + authority: self.authority.expect("authority is not set"), payer: self.payer, system_program: self .system_program @@ -230,7 +231,7 @@ pub struct DecompressCpiAccounts<'a, 'b> { /// The collection to which the asset belongs pub collection: Option<&'b solana_program::account_info::AccountInfo<'a>>, /// The owner or delegate of the asset - pub owner: &'b solana_program::account_info::AccountInfo<'a>, + pub authority: &'b solana_program::account_info::AccountInfo<'a>, /// The account paying for the storage fees pub payer: Option<&'b solana_program::account_info::AccountInfo<'a>>, /// The system program @@ -248,7 +249,7 @@ pub struct DecompressCpi<'a, 'b> { /// The collection to which the asset belongs pub collection: Option<&'b solana_program::account_info::AccountInfo<'a>>, /// The owner or delegate of the asset - pub owner: &'b solana_program::account_info::AccountInfo<'a>, + pub authority: &'b solana_program::account_info::AccountInfo<'a>, /// The account paying for the storage fees pub payer: Option<&'b solana_program::account_info::AccountInfo<'a>>, /// The system program @@ -269,7 +270,7 @@ impl<'a, 'b> DecompressCpi<'a, 'b> { __program: program, asset: accounts.asset, collection: accounts.collection, - owner: accounts.owner, + authority: accounts.authority, payer: accounts.payer, system_program: accounts.system_program, log_wrapper: accounts.log_wrapper, @@ -326,7 +327,7 @@ impl<'a, 'b> DecompressCpi<'a, 'b> { )); } accounts.push(solana_program::instruction::AccountMeta::new_readonly( - *self.owner.key, + *self.authority.key, true, )); if let Some(payer) = self.payer { @@ -376,7 +377,7 @@ impl<'a, 'b> DecompressCpi<'a, 'b> { if let Some(collection) = self.collection { account_infos.push(collection.clone()); } - account_infos.push(self.owner.clone()); + account_infos.push(self.authority.clone()); if let Some(payer) = self.payer { account_infos.push(payer.clone()); } @@ -402,7 +403,7 @@ impl<'a, 'b> DecompressCpi<'a, 'b> { /// /// 0. `[writable]` asset /// 1. `[optional]` collection -/// 2. `[signer]` owner +/// 2. `[signer]` authority /// 3. `[writable, signer, optional]` payer /// 4. `[]` system_program /// 5. `[optional]` log_wrapper @@ -416,7 +417,7 @@ impl<'a, 'b> DecompressCpiBuilder<'a, 'b> { __program: program, asset: None, collection: None, - owner: None, + authority: None, payer: None, system_program: None, log_wrapper: None, @@ -443,8 +444,11 @@ impl<'a, 'b> DecompressCpiBuilder<'a, 'b> { } /// The owner or delegate of the asset #[inline(always)] - pub fn owner(&mut self, owner: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self { - self.instruction.owner = Some(owner); + pub fn authority( + &mut self, + authority: &'b solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.authority = Some(authority); self } /// `[optional account]` @@ -536,7 +540,7 @@ impl<'a, 'b> DecompressCpiBuilder<'a, 'b> { collection: self.instruction.collection, - owner: self.instruction.owner.expect("owner is not set"), + authority: self.instruction.authority.expect("authority is not set"), payer: self.instruction.payer, @@ -559,7 +563,7 @@ struct DecompressCpiBuilderInstruction<'a, 'b> { __program: &'b solana_program::account_info::AccountInfo<'a>, asset: Option<&'b solana_program::account_info::AccountInfo<'a>>, collection: Option<&'b solana_program::account_info::AccountInfo<'a>>, - owner: Option<&'b solana_program::account_info::AccountInfo<'a>>, + authority: Option<&'b solana_program::account_info::AccountInfo<'a>>, payer: Option<&'b solana_program::account_info::AccountInfo<'a>>, system_program: Option<&'b solana_program::account_info::AccountInfo<'a>>, log_wrapper: Option<&'b solana_program::account_info::AccountInfo<'a>>, diff --git a/clients/rust/src/generated/instructions/transfer.rs b/clients/rust/src/generated/instructions/transfer.rs index 5cda0016..9b0288de 100644 --- a/clients/rust/src/generated/instructions/transfer.rs +++ b/clients/rust/src/generated/instructions/transfer.rs @@ -21,6 +21,8 @@ pub struct Transfer { pub payer: Option, /// The new owner to which to transfer the asset pub new_owner: solana_program::pubkey::Pubkey, + /// The system program + pub system_program: Option, /// The SPL Noop Program pub log_wrapper: Option, } @@ -38,7 +40,7 @@ impl Transfer { args: TransferInstructionArgs, remaining_accounts: &[solana_program::instruction::AccountMeta], ) -> solana_program::instruction::Instruction { - let mut accounts = Vec::with_capacity(6 + remaining_accounts.len()); + let mut accounts = Vec::with_capacity(7 + remaining_accounts.len()); accounts.push(solana_program::instruction::AccountMeta::new( self.asset, false, )); @@ -68,6 +70,17 @@ impl Transfer { self.new_owner, false, )); + if let Some(system_program) = self.system_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + system_program, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_CORE_ID, + false, + )); + } if let Some(log_wrapper) = self.log_wrapper { accounts.push(solana_program::instruction::AccountMeta::new_readonly( log_wrapper, @@ -118,7 +131,8 @@ pub struct TransferInstructionArgs { /// 2. `[signer]` authority /// 3. `[writable, signer, optional]` payer /// 4. `[]` new_owner -/// 5. `[optional]` log_wrapper +/// 5. `[optional]` system_program +/// 6. `[optional]` log_wrapper #[derive(Default)] pub struct TransferBuilder { asset: Option, @@ -126,6 +140,7 @@ pub struct TransferBuilder { authority: Option, payer: Option, new_owner: Option, + system_program: Option, log_wrapper: Option, compression_proof: Option, __remaining_accounts: Vec, @@ -168,6 +183,16 @@ impl TransferBuilder { self } /// `[optional account]` + /// The system program + #[inline(always)] + pub fn system_program( + &mut self, + system_program: Option, + ) -> &mut Self { + self.system_program = system_program; + self + } + /// `[optional account]` /// The SPL Noop Program #[inline(always)] pub fn log_wrapper( @@ -209,6 +234,7 @@ impl TransferBuilder { authority: self.authority.expect("authority is not set"), payer: self.payer, new_owner: self.new_owner.expect("new_owner is not set"), + system_program: self.system_program, log_wrapper: self.log_wrapper, }; let args = TransferInstructionArgs { @@ -231,6 +257,8 @@ pub struct TransferCpiAccounts<'a, 'b> { pub payer: Option<&'b solana_program::account_info::AccountInfo<'a>>, /// The new owner to which to transfer the asset pub new_owner: &'b solana_program::account_info::AccountInfo<'a>, + /// The system program + pub system_program: Option<&'b solana_program::account_info::AccountInfo<'a>>, /// The SPL Noop Program pub log_wrapper: Option<&'b solana_program::account_info::AccountInfo<'a>>, } @@ -249,6 +277,8 @@ pub struct TransferCpi<'a, 'b> { pub payer: Option<&'b solana_program::account_info::AccountInfo<'a>>, /// The new owner to which to transfer the asset pub new_owner: &'b solana_program::account_info::AccountInfo<'a>, + /// The system program + pub system_program: Option<&'b solana_program::account_info::AccountInfo<'a>>, /// The SPL Noop Program pub log_wrapper: Option<&'b solana_program::account_info::AccountInfo<'a>>, /// The arguments for the instruction. @@ -268,6 +298,7 @@ impl<'a, 'b> TransferCpi<'a, 'b> { authority: accounts.authority, payer: accounts.payer, new_owner: accounts.new_owner, + system_program: accounts.system_program, log_wrapper: accounts.log_wrapper, __args: args, } @@ -305,7 +336,7 @@ impl<'a, 'b> TransferCpi<'a, 'b> { bool, )], ) -> solana_program::entrypoint::ProgramResult { - let mut accounts = Vec::with_capacity(6 + remaining_accounts.len()); + let mut accounts = Vec::with_capacity(7 + remaining_accounts.len()); accounts.push(solana_program::instruction::AccountMeta::new( *self.asset.key, false, @@ -339,6 +370,17 @@ impl<'a, 'b> TransferCpi<'a, 'b> { *self.new_owner.key, false, )); + if let Some(system_program) = self.system_program { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *system_program.key, + false, + )); + } else { + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + crate::MPL_CORE_ID, + false, + )); + } if let Some(log_wrapper) = self.log_wrapper { accounts.push(solana_program::instruction::AccountMeta::new_readonly( *log_wrapper.key, @@ -366,7 +408,7 @@ impl<'a, 'b> TransferCpi<'a, 'b> { accounts, data, }; - let mut account_infos = Vec::with_capacity(6 + 1 + remaining_accounts.len()); + let mut account_infos = Vec::with_capacity(7 + 1 + remaining_accounts.len()); account_infos.push(self.__program.clone()); account_infos.push(self.asset.clone()); if let Some(collection) = self.collection { @@ -377,6 +419,9 @@ impl<'a, 'b> TransferCpi<'a, 'b> { account_infos.push(payer.clone()); } account_infos.push(self.new_owner.clone()); + if let Some(system_program) = self.system_program { + account_infos.push(system_program.clone()); + } if let Some(log_wrapper) = self.log_wrapper { account_infos.push(log_wrapper.clone()); } @@ -401,7 +446,8 @@ impl<'a, 'b> TransferCpi<'a, 'b> { /// 2. `[signer]` authority /// 3. `[writable, signer, optional]` payer /// 4. `[]` new_owner -/// 5. `[optional]` log_wrapper +/// 5. `[optional]` system_program +/// 6. `[optional]` log_wrapper pub struct TransferCpiBuilder<'a, 'b> { instruction: Box>, } @@ -415,6 +461,7 @@ impl<'a, 'b> TransferCpiBuilder<'a, 'b> { authority: None, payer: None, new_owner: None, + system_program: None, log_wrapper: None, compression_proof: None, __remaining_accounts: Vec::new(), @@ -466,6 +513,16 @@ impl<'a, 'b> TransferCpiBuilder<'a, 'b> { self } /// `[optional account]` + /// The system program + #[inline(always)] + pub fn system_program( + &mut self, + system_program: Option<&'b solana_program::account_info::AccountInfo<'a>>, + ) -> &mut Self { + self.instruction.system_program = system_program; + self + } + /// `[optional account]` /// The SPL Noop Program #[inline(always)] pub fn log_wrapper( @@ -538,6 +595,8 @@ impl<'a, 'b> TransferCpiBuilder<'a, 'b> { new_owner: self.instruction.new_owner.expect("new_owner is not set"), + system_program: self.instruction.system_program, + log_wrapper: self.instruction.log_wrapper, __args: args, }; @@ -555,6 +614,7 @@ struct TransferCpiBuilderInstruction<'a, 'b> { authority: Option<&'b solana_program::account_info::AccountInfo<'a>>, payer: Option<&'b solana_program::account_info::AccountInfo<'a>>, new_owner: Option<&'b solana_program::account_info::AccountInfo<'a>>, + system_program: Option<&'b solana_program::account_info::AccountInfo<'a>>, log_wrapper: Option<&'b solana_program::account_info::AccountInfo<'a>>, compression_proof: Option, /// Additional instruction accounts `(AccountInfo, is_writable, is_signer)`. diff --git a/idls/mpl_core.json b/idls/mpl_core.json index ac21832b..e107e416 100644 --- a/idls/mpl_core.json +++ b/idls/mpl_core.json @@ -938,6 +938,15 @@ "The new owner to which to transfer the asset" ] }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false, + "isOptional": true, + "docs": [ + "The system program" + ] + }, { "name": "logWrapper", "isMut": false, @@ -1127,7 +1136,7 @@ ] }, { - "name": "owner", + "name": "authority", "isMut": false, "isSigner": true, "docs": [ @@ -1195,7 +1204,7 @@ ] }, { - "name": "owner", + "name": "authority", "isMut": false, "isSigner": true, "docs": [ @@ -2275,6 +2284,16 @@ "code": 21, "name": "MissingNewOwner", "msg": "Missing new owner" + }, + { + "code": 22, + "name": "MissingSystemProgram", + "msg": "Missing system program" + }, + { + "code": 23, + "name": "NotImplemented", + "msg": "Not implemented" } ], "metadata": {